Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update metrics configuration patch #1548

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kaylareopelle
Copy link
Contributor

@kaylareopelle kaylareopelle commented Dec 5, 2023

This PR updates the metrics configuration patch to match the functionality for traces in the OpenTelemetry::SDK::Configurator.

Once this PR is merged, the metric exporter can be automatically configured using the OTLP_METRICS_EXPORTER environment variable.

The environment variable has options for:

  • otlp (default)
  • console
  • none

Like the Traces exporter, more than one exporter can be configured.

This draws a lot from the structure in: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/sdk/lib/opentelemetry/sdk/configurator.rb

It intends to follow the specification: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md?plain=1#L256

@kaylareopelle kaylareopelle changed the title WIP - Update metrics configuration patch WIP - feat: Update metrics configuration patch Dec 5, 2023
Copy link
Contributor

github-actions bot commented Mar 1, 2024

👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this pull request will be closed eventually by the stale bot

@github-actions github-actions bot added the stale label Mar 1, 2024
@kaylareopelle
Copy link
Contributor Author

Blocked by #1551

@github-actions github-actions bot removed the stale label Mar 6, 2024
@kaylareopelle kaylareopelle changed the title WIP - feat: Update metrics configuration patch feat: Update metrics configuration patch Apr 3, 2024
Copy link
Contributor

github-actions bot commented May 5, 2024

👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this pull request will be closed eventually by the stale bot

…variable

The environment variable has options for:
* console (default)
* otlp
* in-memory
* none

Like the Traces exporter, more than one exporter can be configured
* Default option is now OTLP
* In-Memory option removed, it's not in the spec
* PeriodicMetricReader added for both Console and OTLP exporters
* Add the metrics OTLP exporter gem to the test gem group
exporter: Metrics::Export::ConsoleMetricPullExporter.new
)
)
when 'otlp'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwear @xuan-cao-swi - The specs state that OTLP should be the default exporter or OTEL_METRICS_EXPORTER, so I updated the tests to reflect this and installed the OTLP exporter in the test group of the Gemile.

However, the OTLP exporter brings in the protobuf dependencies, making the entire metrics_sdk test suite incompatible with JRuby.

It seems like the tracing test suite gets around this by avoiding any mention of the OTLP exporter in the tests, even though the spec also expects OTLP to be the default exporter for that signal (the tests use zipkin instead).

I don't want to skip JRuby for all tests in the metrics_sdk.

My current thoughts for solutions are:

  1. conditionally install the OTLP exporter in the test environment if JRuby is present and skip the related tests if JRuby is present
  2. omit the OTLP exporter from the tests entirely, and bring in an alternate exporter for the tests, following the pattern for traces (in-memory metrics exporter seems like the best candidate, even though it's not part of the spec)
  3. something else...?

What do y'all think would be the best next step?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Review
Status: Placeholder
Development

Successfully merging this pull request may close these issues.

2 participants