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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f18ccfecc949d79b9c0e06850f440ce7f137dcb4111e2646bd730e9c51107cb
4
- data.tar.gz: e1456ae29aa3fc8581e142ef858562033a6fc27e154718af9aeb49c2045385df
3
+ metadata.gz: 38dd8206d1bf9212b72a56b017870d9be53ff8136e4ca3079778977025e2147c
4
+ data.tar.gz: ae1f04fbebf274f7e04aff463fb830a3e2e51428cce42de51b774b1992db1301
5
5
  SHA512:
6
- metadata.gz: 90942bebaa75ea64f57609c70f4be2c50a4dd8e0809f9b059e7c9d8d25ba0aeb6c31c29ad731e878fbe9df208dcce2998d2fe2e6ad6abfb1731dedcbca2cfb69
7
- data.tar.gz: fd117c9046126740d7181b378752e2f1cfc169599a4df073c5c0c6f0e9ff842fb32b70ed89fa1c1a7dc726ed7cd6a7d863e6894d2075d108bfaa66aae4af16fc
6
+ metadata.gz: 9266099177298e3228ad5ad57fbd466e4f201b2fe8903be555e67819c26564d7e9a5cd2704b68b05230d612135086ff33156ab30e3d1262acadb359ec8d8705e
7
+ data.tar.gz: 881cb73ac6ff636cc2d6dc6d879d3a36f39683eb9aa65215a3f8da250eaaebf60e60cee2dc43f78c26a94dd01404e200867b933fe479163b1a043557516eccee
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.3.0 - 2023-06-22
4
+
5
+ - Updated OpenTelemetry to
6
+ [v1.3.0](https://github.com/open-telemetry/opentelemetry-ruby/blob/main/sdk/CHANGELOG.md#v130--2023-06-08).
7
+
3
8
  ## v1.2.0 - 2022-10-15
4
9
 
5
10
  - Updated OpenTelemetry to
@@ -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/PROJECT_ID')
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
- "#{@dsn.app_addr}/traces/#{trace_id}"
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, :port, :project_id, :token
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
- @port = uri.port
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 app_addr
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}:#{@port}"
39
+ "#{@scheme}://#{@host}"
41
40
  end
42
41
 
43
- def otlp_addr
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}:#{@port}"
46
+ "#{@scheme}://#{@host}"
47
47
  end
48
48
  end
49
49
  end
@@ -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::DEFAULT
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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uptrace
4
- VERSION = '1.3.0'
4
+ VERSION = '1.3.1'
5
5
  end
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.otlp_addr}/v1/traces",
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.0
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-06-22 00:00:00.000000000 Z
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.0
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.0
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.0
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.0
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.28.2
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.28.2
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.19.1
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.19.1
110
+ version: 0.33.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rubocop-rake
113
113
  requirement: !ruby/object:Gem::Requirement