From 0c372cdb7bc8f087cc5d2e3ff148133ab3a6686b Mon Sep 17 00:00:00 2001 From: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> Date: Tue, 22 Oct 2024 14:56:14 -0700 Subject: [PATCH 1/2] test: Resolve Truffle ruby intermittent failures on exporters (#1752) * test: Use Zlib.gunzip to compare body with estr Zlib.gzip adds a timestamp, which may be different than the one in the encoded req.body due to the test timing, and may cause an intermittent failure. Compare the unzipped request with the encoded_estr to avoid the timestamp interfering with the equality check. Co-authored-by: Tanna McClure * test: Remove skip for TruffleRuby The assertions in this test differ from the other intermittent failures. Hopefully, the test is not failing and was skipped because the name of the test is the same as others. * chore: Remove comment --------- Co-authored-by: Tanna McClure --- .../test/opentelemetry/exporter/otlp/common/common_test.rb | 3 --- .../opentelemetry/exporter/otlp/http/trace_exporter_test.rb | 5 +---- .../exporter/otlp/metrics/metrics_exporter_test.rb | 4 +--- .../otlp/test/opentelemetry/exporter/otlp/exporter_test.rb | 5 +---- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/exporter/otlp-common/test/opentelemetry/exporter/otlp/common/common_test.rb b/exporter/otlp-common/test/opentelemetry/exporter/otlp/common/common_test.rb index 1d079711d..ea0635ff1 100644 --- a/exporter/otlp-common/test/opentelemetry/exporter/otlp/common/common_test.rb +++ b/exporter/otlp-common/test/opentelemetry/exporter/otlp/common/common_test.rb @@ -41,9 +41,6 @@ end it 'translates all the things' do - # TODO: See issue #1507 to fix - skip 'Intermittently fails' if RUBY_ENGINE == 'truffleruby' - OpenTelemetry.tracer_provider = OpenTelemetry::SDK::Trace::TracerProvider.new(resource: OpenTelemetry::SDK::Resources::Resource.telemetry_sdk) tracer = OpenTelemetry.tracer_provider.tracer('tracer', 'v0.0.1') other_tracer = OpenTelemetry.tracer_provider.tracer('other_tracer') diff --git a/exporter/otlp-http/test/opentelemetry/exporter/otlp/http/trace_exporter_test.rb b/exporter/otlp-http/test/opentelemetry/exporter/otlp/http/trace_exporter_test.rb index 11f286595..1e3cf78ef 100644 --- a/exporter/otlp-http/test/opentelemetry/exporter/otlp/http/trace_exporter_test.rb +++ b/exporter/otlp-http/test/opentelemetry/exporter/otlp/http/trace_exporter_test.rb @@ -468,9 +468,6 @@ end it 'translates all the things' do - # TODO: See issue #1507 to fix - skip 'Intermittently fails' if RUBY_ENGINE == 'truffleruby' - stub_request(:post, 'http://localhost:4318/v1/traces').to_return(status: 200) processor = OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(exporter) tracer = OpenTelemetry.tracer_provider.tracer('tracer', 'v0.0.1') @@ -635,7 +632,7 @@ ) assert_requested(:post, 'http://localhost:4318/v1/traces') do |req| - req.body == Zlib.gzip(encoded_etsr) + Zlib.gunzip(req.body) == encoded_etsr end end end diff --git a/exporter/otlp-metrics/test/opentelemetry/exporter/otlp/metrics/metrics_exporter_test.rb b/exporter/otlp-metrics/test/opentelemetry/exporter/otlp/metrics/metrics_exporter_test.rb index bd9d45876..93176ce33 100644 --- a/exporter/otlp-metrics/test/opentelemetry/exporter/otlp/metrics/metrics_exporter_test.rb +++ b/exporter/otlp-metrics/test/opentelemetry/exporter/otlp/metrics/metrics_exporter_test.rb @@ -556,8 +556,6 @@ end it 'translates all the things' do - skip 'Intermittently fails' if RUBY_ENGINE == 'truffleruby' - stub_request(:post, 'http://localhost:4318/v1/metrics').to_return(status: 200) meter_provider.add_metric_reader(exporter) meter = meter_provider.meter('test') @@ -639,7 +637,7 @@ ) assert_requested(:post, 'http://localhost:4318/v1/metrics') do |req| - req.body == Zlib.gzip(encoded_etsr) # is asserting that the body of the HTTP request is equal to the result of gzipping the encoded_etsr. + Zlib.gunzip(req.body) == encoded_etsr end end end diff --git a/exporter/otlp/test/opentelemetry/exporter/otlp/exporter_test.rb b/exporter/otlp/test/opentelemetry/exporter/otlp/exporter_test.rb index f37fc3a8d..2303f2e5d 100644 --- a/exporter/otlp/test/opentelemetry/exporter/otlp/exporter_test.rb +++ b/exporter/otlp/test/opentelemetry/exporter/otlp/exporter_test.rb @@ -611,9 +611,6 @@ end it 'translates all the things' do - # TODO: See issue #1507 to fix - skip 'Intermittently fails' if RUBY_ENGINE == 'truffleruby' - stub_request(:post, 'http://localhost:4318/v1/traces').to_return(status: 200) processor = OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(exporter) tracer = OpenTelemetry.tracer_provider.tracer('tracer', 'v0.0.1') @@ -778,7 +775,7 @@ ) assert_requested(:post, 'http://localhost:4318/v1/traces') do |req| - req.body == Zlib.gzip(encoded_etsr) + Zlib.gunzip(req.body) == encoded_etsr end end end From 555b062ef9421784c132aa9b97b29ec637b13b0f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 16:13:49 -0700 Subject: [PATCH 2/2] release: Release 2 gems (#1754) * release: Release 2 gems * opentelemetry-metrics-api 0.1.1 (was 0.1.0) * opentelemetry-metrics-sdk 0.3.0 (was 0.2.0) * chore: Update CHANGELOG for metrics api * chore: Increase minimum metrics API version Refactors prevent a lower version from being compatible with the latest metrics SDK * chore: Use fixed instead of added in changelog --------- Co-authored-by: Daniel Azuma Co-authored-by: Kayla Reopelle --- metrics_api/CHANGELOG.md | 4 ++++ metrics_api/lib/opentelemetry/metrics/version.rb | 2 +- metrics_sdk/CHANGELOG.md | 6 ++++++ metrics_sdk/lib/opentelemetry/sdk/metrics/version.rb | 2 +- metrics_sdk/opentelemetry-metrics-sdk.gemspec | 2 +- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/metrics_api/CHANGELOG.md b/metrics_api/CHANGELOG.md index bdadf3885..afbcca5ea 100644 --- a/metrics_api/CHANGELOG.md +++ b/metrics_api/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-metrics-api +### v0.1.1 / 2024-10-22 + +* FIXED: Refactor instrument validation + ### v0.1.0 / 2024-07-31 Initial release. diff --git a/metrics_api/lib/opentelemetry/metrics/version.rb b/metrics_api/lib/opentelemetry/metrics/version.rb index a1238c721..ab557fc81 100644 --- a/metrics_api/lib/opentelemetry/metrics/version.rb +++ b/metrics_api/lib/opentelemetry/metrics/version.rb @@ -7,6 +7,6 @@ module OpenTelemetry module Metrics ## Current OpenTelemetry metrics version - VERSION = '0.1.0' + VERSION = '0.1.1' end end diff --git a/metrics_sdk/CHANGELOG.md b/metrics_sdk/CHANGELOG.md index 1328411e2..d8be534a1 100644 --- a/metrics_sdk/CHANGELOG.md +++ b/metrics_sdk/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History: opentelemetry-metrics-sdk +### v0.3.0 / 2024-10-22 + +* ADDED: Add basic metrics view +* FIXED: Coerce aggregation_temporality to symbol +* FIXED: Add warning if invalid meter name given + ### v0.2.0 / 2024-08-27 * ADDED: Add basic periodic exporting metric_reader diff --git a/metrics_sdk/lib/opentelemetry/sdk/metrics/version.rb b/metrics_sdk/lib/opentelemetry/sdk/metrics/version.rb index 4016895fb..17e0d9570 100644 --- a/metrics_sdk/lib/opentelemetry/sdk/metrics/version.rb +++ b/metrics_sdk/lib/opentelemetry/sdk/metrics/version.rb @@ -8,7 +8,7 @@ module OpenTelemetry module SDK module Metrics # Current OpenTelemetry metrics sdk version - VERSION = '0.2.0' + VERSION = '0.3.0' end end end diff --git a/metrics_sdk/opentelemetry-metrics-sdk.gemspec b/metrics_sdk/opentelemetry-metrics-sdk.gemspec index f7459963e..1919305ac 100644 --- a/metrics_sdk/opentelemetry-metrics-sdk.gemspec +++ b/metrics_sdk/opentelemetry-metrics-sdk.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'opentelemetry-api', '~> 1.1' - spec.add_dependency 'opentelemetry-metrics-api' + spec.add_dependency 'opentelemetry-metrics-api', '~> 0.1.1' spec.add_dependency 'opentelemetry-sdk', '~> 1.2' spec.add_development_dependency 'benchmark-ipsa', '~> 0.2.0'