uptrace 1.5.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 432153daa6ce8e616380e83439ba917f8ef10cffd3588b445edb2c096fdfc1af
4
- data.tar.gz: 0af81b4be764b76793acba0fc8a439f8402669b9a177be030d1042206d2913bc
3
+ metadata.gz: 971f276de0abbfd5a5b4e505927b12a92f206a47f857c7d2a1f55106e1739dde
4
+ data.tar.gz: ed4e4cb6f17964dc4819dca13b998a69fba3ac20ccea4ba54b14701d069d584e
5
5
  SHA512:
6
- metadata.gz: 7cf423378a43884bbd7319ab4335c1a6d4deceacfd157b6129cc98e0b66d5bc595d68ffc723c1dc85ecfdcb38055e08a3e0c2987217788936fddcd7c4d1efa1c
7
- data.tar.gz: fa5437b433c4d25a61051e6b39070a44a09b09b15a23d65d759b2afcb297e30ee10e4b81f3ca86ea29c02f08500fe91a6c2aa2ef9f006795f43450927dd0c0ff
6
+ metadata.gz: a4c60178f506bb083dc4fe13fedfac8f440feebac8a23c6dfd4040388448c2c20dee1977cdd65df69237dfd6626ed2604877fd418a699a4de58d91ffa844864b
7
+ data.tar.gz: edb380d1fabc98cfd62b667dc3cdb8b343398a97e6ef89a1769057d6c6e6f91548ba1e37b65af7e475d31ee66c12c9ae52947c77437c1de5eafe28191b797fed
data/README.md CHANGED
@@ -1,17 +1,17 @@
1
1
  # Uptrace Ruby exporter for OpenTelemetry
2
2
 
3
3
  ![build workflow](https://github.com/uptrace/uptrace-ruby/actions/workflows/build.yml/badge.svg)
4
- [![Documentation](https://img.shields.io/badge/uptrace-documentation-informational)](https://uptrace.dev/get/opentelemetry-ruby.html)
4
+ [![Documentation](https://img.shields.io/badge/uptrace-documentation-informational)](https://uptrace.dev/get/opentelemetry-ruby)
5
5
  [![Chat](https://img.shields.io/badge/-telegram-red?color=white&logo=telegram&logoColor=black)](https://t.me/uptrace)
6
6
 
7
- <a href="https://uptrace.dev/get/opentelemetry-ruby.html">
8
- <img src="https://uptrace.dev/get/devicon/ruby-original.svg" height="200px" />
7
+ <a href="https://uptrace.dev/get/opentelemetry-ruby">
8
+ <img src="https://uptrace.dev/devicon/ruby-original.svg" height="200px" />
9
9
  </a>
10
10
 
11
11
  ## Introduction
12
12
 
13
13
  uptrace-ruby is an OpenTelemery distribution configured to export
14
- [traces](https://uptrace.dev/opentelemetry/distributed-tracing.html) to Uptrace.
14
+ [traces](https://uptrace.dev/opentelemetry/distributed-tracing) to Uptrace.
15
15
 
16
16
  ## Quickstart
17
17
 
@@ -71,7 +71,6 @@ OpenTelemetry.tracer_provider.shutdown
71
71
  ## Links
72
72
 
73
73
  - [Examples](example)
74
- - [Documentation](https://uptrace.dev/get/opentelemetry-ruby.html)
75
- - [OpenTelemetry Instrumentations](https://uptrace.dev/opentelemetry/instrumentations/?lang=ruby)
76
- - [OpenTelemetry Rails](https://uptrace.dev/opentelemetry/instrumentations/ruby-rails.html)
77
- - [OpenTelemetry Sinatra](https://uptrace.dev/opentelemetry/instrumentations/ruby-sinatra.html)
74
+ - [Documentation](https://uptrace.dev/get/opentelemetry-ruby)
75
+ - [OpenTelemetry Rails](https://uptrace.dev/guides/opentelemetry-rails)
76
+ - [OpenTelemetry Sinatra](https://uptrace.dev/guides/opentelemetry-sinatra)
data/lib/uptrace/dsn.rb CHANGED
@@ -40,7 +40,7 @@ module Uptrace
40
40
  end
41
41
 
42
42
  def otlp_http_endpoint
43
- return 'https://otlp.uptrace.dev' if @host == 'uptrace.dev'
43
+ return 'https://api.uptrace.dev' if @host == 'uptrace.dev'
44
44
  return "#{@scheme}://#{@host}:#{@http_port}" if @http_port != 443
45
45
 
46
46
  "#{@scheme}://#{@host}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uptrace
4
- VERSION = '1.5.0'
4
+ VERSION = '1.8.0'
5
5
  end
data/lib/uptrace.rb CHANGED
@@ -3,6 +3,8 @@
3
3
  require 'logger'
4
4
 
5
5
  require 'opentelemetry/exporter/otlp'
6
+ require 'opentelemetry-metrics-sdk'
7
+ require 'opentelemetry-exporter-otlp-metrics'
6
8
 
7
9
  # Uptrace provides Uptrace exporters for OpenTelemetry.
8
10
  module Uptrace
@@ -38,6 +40,8 @@ module Uptrace
38
40
 
39
41
  yield c if block_given?
40
42
  end
43
+
44
+ OpenTelemetry.meter_provider.add_metric_reader(metric_exporter(@client.dsn))
41
45
  end
42
46
 
43
47
  private
@@ -45,7 +49,6 @@ module Uptrace
45
49
  def span_processor(dsn)
46
50
  exporter = OpenTelemetry::Exporter::OTLP::Exporter.new(
47
51
  endpoint: "#{dsn.otlp_http_endpoint}/v1/traces",
48
- # Set the Uptrace DSN here or use UPTRACE_DSN env var.
49
52
  headers: { 'uptrace-dsn': dsn.to_s },
50
53
  compression: 'gzip'
51
54
  )
@@ -56,6 +59,14 @@ module Uptrace
56
59
  schedule_delay: 5_000
57
60
  )
58
61
  end
62
+
63
+ def metric_exporter(dsn)
64
+ OpenTelemetry::Exporter::OTLP::Metrics::MetricsExporter.new(
65
+ endpoint: "#{dsn.otlp_http_endpoint}/v1/metrics",
66
+ headers: { 'uptrace-dsn': dsn.to_s },
67
+ compression: 'gzip'
68
+ )
69
+ end
59
70
  end
60
71
 
61
72
  require 'uptrace/version'
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uptrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uptrace Authors
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-07-25 00:00:00.000000000 Z
10
+ date: 2025-03-17 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: opentelemetry-exporter-otlp
@@ -16,28 +15,56 @@ dependencies:
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: 0.28.1
18
+ version: 0.30.0
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: 0.28.1
25
+ version: 0.30.0
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: opentelemetry-sdk
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: 1.5.0
32
+ version: 1.8.0
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: 1.5.0
39
+ version: 1.8.0
40
+ - !ruby/object:Gem::Dependency
41
+ name: opentelemetry-exporter-otlp-metrics
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: 0.4.0
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: 0.4.0
54
+ - !ruby/object:Gem::Dependency
55
+ name: opentelemetry-metrics-sdk
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: 0.6.0
61
+ type: :runtime
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: 0.6.0
41
68
  - !ruby/object:Gem::Dependency
42
69
  name: bundler
43
70
  requirement: !ruby/object:Gem::Requirement
@@ -172,7 +199,6 @@ licenses:
172
199
  - BSD-2-Clause
173
200
  metadata:
174
201
  rubygems_mfa_required: 'true'
175
- post_install_message:
176
202
  rdoc_options: []
177
203
  require_paths:
178
204
  - lib
@@ -187,8 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
213
  - !ruby/object:Gem::Version
188
214
  version: '0'
189
215
  requirements: []
190
- rubygems_version: 3.4.10
191
- signing_key:
216
+ rubygems_version: 3.6.2
192
217
  specification_version: 4
193
218
  summary: Uptrace Ruby exporter for OpenTelemetry
194
219
  test_files: []