uptrace 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/uptrace/client.rb +3 -2
- data/lib/uptrace/dsn.rb +8 -8
- data/lib/uptrace/id_generator.rb +1 -1
- data/lib/uptrace/version.rb +1 -1
- data/lib/uptrace.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38dd8206d1bf9212b72a56b017870d9be53ff8136e4ca3079778977025e2147c
|
4
|
+
data.tar.gz: ae1f04fbebf274f7e04aff463fb830a3e2e51428cce42de51b774b1992db1301
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9266099177298e3228ad5ad57fbd466e4f201b2fe8903be555e67819c26564d7e9a5cd2704b68b05230d612135086ff33156ab30e3d1262acadb359ec8d8705e
|
7
|
+
data.tar.gz: 881cb73ac6ff636cc2d6dc6d879d3a36f39683eb9aa65215a3f8da250eaaebf60e60cee2dc43f78c26a94dd01404e200867b933fe479163b1a043557516eccee
|
data/CHANGELOG.md
CHANGED
data/lib/uptrace/client.rb
CHANGED
@@ -17,7 +17,7 @@ module Uptrace
|
|
17
17
|
Uptrace.logger.error("Uptrace is disabled: #{e.message}")
|
18
18
|
@disabled = true
|
19
19
|
|
20
|
-
@dsn = DSN.new('https://TOKEN@uptrace.dev
|
20
|
+
@dsn = DSN.new('https://TOKEN@uptrace.dev')
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -30,7 +30,8 @@ module Uptrace
|
|
30
30
|
def trace_url(span = nil)
|
31
31
|
span = OpenTelemetry::Trace.current_span if span.nil?
|
32
32
|
trace_id = span.context.hex_trace_id
|
33
|
-
|
33
|
+
span_id = span.context.hex_span_id
|
34
|
+
"#{@dsn.site_url}/traces/#{trace_id}?span_id=#{span_id}"
|
34
35
|
end
|
35
36
|
end
|
36
37
|
end
|
data/lib/uptrace/dsn.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module Uptrace
|
4
4
|
# Uptrace DSN
|
5
5
|
class DSN
|
6
|
-
attr_reader :dsn, :scheme, :host, :
|
6
|
+
attr_reader :dsn, :scheme, :host, :http_port, :token
|
7
7
|
|
8
8
|
def initialize(dsn)
|
9
9
|
raise ArgumentError, "DSN can't be empty" if dsn.empty?
|
@@ -17,8 +17,7 @@ module Uptrace
|
|
17
17
|
@dsn = dsn
|
18
18
|
@scheme = uri.scheme
|
19
19
|
@host = uri.host
|
20
|
-
@
|
21
|
-
@project_id = uri.path.delete_prefix('/')
|
20
|
+
@http_port = uri.port
|
22
21
|
@token = uri.user
|
23
22
|
|
24
23
|
%w[scheme host].each do |k|
|
@@ -27,23 +26,24 @@ module Uptrace
|
|
27
26
|
end
|
28
27
|
|
29
28
|
@host = 'uptrace.dev' if @host == 'api.uptrace.dev'
|
30
|
-
return if @host != 'uptrace.dev'
|
31
29
|
end
|
32
30
|
|
33
31
|
def to_s
|
34
32
|
@dsn
|
35
33
|
end
|
36
34
|
|
37
|
-
def
|
35
|
+
def site_url
|
38
36
|
return 'https://app.uptrace.dev' if @host == 'uptrace.dev'
|
37
|
+
return "#{@scheme}://#{@host}:#{@http_port}" if @http_port != 443
|
39
38
|
|
40
|
-
"#{@scheme}://#{@host}
|
39
|
+
"#{@scheme}://#{@host}"
|
41
40
|
end
|
42
41
|
|
43
|
-
def
|
42
|
+
def otlp_http_endpoint
|
44
43
|
return 'https://otlp.uptrace.dev' if @host == 'uptrace.dev'
|
44
|
+
return "#{@scheme}://#{@host}:#{@http_port}" if @http_port != 443
|
45
45
|
|
46
|
-
"#{@scheme}://#{@host}
|
46
|
+
"#{@scheme}://#{@host}"
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
data/lib/uptrace/id_generator.rb
CHANGED
@@ -16,7 +16,7 @@ module Uptrace
|
|
16
16
|
# the class `Random`.
|
17
17
|
#
|
18
18
|
# @return [#bytes]
|
19
|
-
RANDOM = Random.respond_to?(:bytes) ? Random : Random
|
19
|
+
RANDOM = Random.respond_to?(:bytes) ? Random : Random.new
|
20
20
|
|
21
21
|
# Generates a valid trace identifier, a 16-byte string with at least one
|
22
22
|
# non-zero byte.
|
data/lib/uptrace/version.rb
CHANGED
data/lib/uptrace.rb
CHANGED
@@ -44,7 +44,7 @@ module Uptrace
|
|
44
44
|
|
45
45
|
def span_processor(dsn)
|
46
46
|
exporter = OpenTelemetry::Exporter::OTLP::Exporter.new(
|
47
|
-
endpoint: "#{dsn.
|
47
|
+
endpoint: "#{dsn.otlp_http_endpoint}/v1/traces",
|
48
48
|
# Set the Uptrace DSN here or use UPTRACE_DSN env var.
|
49
49
|
headers: { 'uptrace-dsn': dsn.to_s },
|
50
50
|
compression: 'gzip'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uptrace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Uptrace Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-exporter-otlp
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.26.
|
19
|
+
version: 0.26.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.26.
|
26
|
+
version: 0.26.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: opentelemetry-sdk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.3.
|
33
|
+
version: 1.3.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.3.
|
40
|
+
version: 1.3.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,28 +86,28 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 1.
|
89
|
+
version: 1.57.2
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.
|
96
|
+
version: 1.57.2
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rubocop-minitest
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.
|
103
|
+
version: 0.33.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.
|
110
|
+
version: 0.33.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rubocop-rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|