codecov_opentelem 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/codecov_opentelem/coverage_exporter.rb +10 -6
- data/lib/codecov_opentelem/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a837d9537c3dccbc0d656e4bd7c7a196073c95e5686a02252a69f267b49be89b
|
4
|
+
data.tar.gz: 6feed841349acebe12bbc6afc3f1f87f9b897d86867e9fc91a4a442f3930b10f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0823f094eb916153de0aae3a29496bd9f1245648159435e6c070ef86e371b9015f399efc3f54e3cc9fe45081357c524ea9c5fbf01f216fb78f3f41b3e9853f7
|
7
|
+
data.tar.gz: 7fd37d56e8ca61aac7ee18537a486a865efe4a834a77eabeb8b3dab17a002c4430cfca3a6af4b603dbbed0e598b803405cd61045b6291aaa692b5b9955adf591
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'base64'
|
3
4
|
require 'json'
|
4
|
-
require 'uri'
|
5
5
|
require 'net/http'
|
6
|
+
require 'uri'
|
6
7
|
|
7
|
-
require 'opentelemetry/sdk'
|
8
8
|
require 'coverage'
|
9
|
+
require 'opentelemetry/sdk'
|
9
10
|
|
10
11
|
module CoverageSpanFilter
|
11
12
|
REGEX_NAME = 'name_regex'
|
@@ -78,14 +79,17 @@ class CoverageExporter < OpenTelemetry::SDK::Trace::Export::SpanExporter
|
|
78
79
|
span_hash[k] = v
|
79
80
|
end
|
80
81
|
|
82
|
+
cov_string = cov.map{ |k, v| "\"#{k}\":[#{v.map{ |i| i.nil? ? "null" : i}.join(',')}]"}.join(',')
|
83
|
+
cov_string = "{\"coverage\":{#{cov_string}}}"
|
84
|
+
|
81
85
|
if !cov.nil?
|
82
86
|
span_hash['codecov'] = {
|
83
|
-
'coverage':
|
84
|
-
'type': '
|
87
|
+
'coverage': Base64.strict_encode64(cov_string),
|
88
|
+
'type': 'bytes',
|
85
89
|
}
|
86
|
-
tracked_spans.append(span_hash
|
90
|
+
tracked_spans.append(span_hash)
|
87
91
|
elsif rand() < @untracked_export_rate
|
88
|
-
untracked_spans.append(span_hash
|
92
|
+
untracked_spans.append(span_hash)
|
89
93
|
end
|
90
94
|
end
|
91
95
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codecov_opentelem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ahmed-Elghrbawy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|