这是indexloc提供的服务,不要输入任何密码
Skip to content

Implement new SemConv exporter health metrics #7265

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

Merged
merged 60 commits into from
Jun 3, 2025

Conversation

JonasKunz
Copy link
Contributor

@JonasKunz JonasKunz commented Apr 10, 2025

This PR implements the new, experimental exporter health metrics defined in semantic conventions. The other metrics will be added in follow-up PRs.

We already have some experimental health metrics in the SDK, which I intend to eventually replace with the new ones from semantic conventions. I'm envisioning the replacement process as follows:

  • Implement the new health metrics in a series of PRs, but have them opt-in and keep reporting the legacy metrics by default
  • Add autoconfiguration support to configure the health metrics level: e.g. on, off, legacy and maybe in the future extended for opt-in attributes / metrics
  • Switch the default setting from legacy to on, this will be a breaking change
  • After some grace period remove support for the legacy metrics

@jack-berg
Copy link
Member

Hey @JonasKunz give me a heads up when you think this is ready for review. Happy to start with a high level review while its still in draft!

@JonasKunz
Copy link
Contributor Author

@jack-berg a high level review would be appreciated! I'm happy with the overall structure and would mostly polish from now on, so it would be great to get your feedback before I polish things we'll end up changing anyway.

I've updated the PR comment to give an introduction on how I envision the feature implementation in general.

# Conflicts:
#	exporters/common/src/main/java/io/opentelemetry/exporter/internal/ExporterMetrics.java
#	exporters/otlp/all/src/main/java/io/opentelemetry/exporter/otlp/http/metrics/OtlpHttpMetricExporterBuilder.java
#	exporters/otlp/all/src/main/java/io/opentelemetry/exporter/otlp/metrics/OtlpGrpcMetricExporterBuilder.java
Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

Left a variety of comments, but this is on the right track. Thanks for working on this.

private static final AttributeKey<Boolean> ATTRIBUTE_KEY_SUCCESS = booleanKey("success");
/**
* This class is internal and is hence not for public use. Its APIs are unstable and can change at
* any time.
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiosity did the build force this comment to pass?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes:

> Compilation failed; see the compiler output below.
  /Users/jonas/git/otel/opentelemetry-java/exporters/common/src/main/java/io/opentelemetry/exporter/internal/ExporterMetrics.java:29: warning: [OtelInternalJavadoc] This public internal class doesn't end with any of the applicable javadoc disclaimers: "This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.", or "This class is internal and experimental. Its APIs are unstable and can change at any time. Its APIs (or a version of them) may be promoted to the public stable API in the future, but no guarantees are made."
    public enum Signal {
           ^
      (see https://errorprone.info/bugpattern/OtelInternalJavadoc)
  1 error
  1 warning

Is that not intentional?

@JonasKunz JonasKunz requested a review from jack-berg May 20, 2025 13:35
Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

There may be opportunities to clean up some things (e.g. its not great that ExporterInstrumentation and ExporterMetrics each have an internal class/interface called Recording), but this is great start as far as I'm concerned. New public API surface area and telemetry output looks good.

A couple more non-blocking comments

JonasKunz and others added 5 commits May 28, 2025 14:41
…nal/grpc/GrpcExporterTest.java

Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com>
…nal/http/HttpExporterTest.java

Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com>
@jack-berg jack-berg merged commit f720735 into open-telemetry:main Jun 3, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants