-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
prefix should be consistent for internal metrics #9315
Comments
Note that there's also an OTEP that has specific metrics that may require a rename later on open-telemetry/oteps#238, but adding a prefix would still be useful in the short term. |
My vote is to NOT do this, and to if needed use relevant names for the meter that produces these metrics. |
@bogdandrutu As an end-user, wouldn't this potentially cause a problem? In the sense that this would rely on my backend is to interpret the meter name and apply it as a prefix if I wanted to be able to continue using my dashboards? Or I would end up having to double generate the telemetry? And then cut-over once I'm satisfied w/ the level of historical data about my collector to. Would an alternative here would be to strip the prefix from the prometheus generated metrics via feature gate move towards using I guess ultimately, what I'm trying to achieve here is a recommended path moving forward for end-users that would like to transition from prom metrics to OTLP metrics (or maybe even use both together if there's a case for this, i don't know) |
The instrumentation scope is the recommended mechanism to use to "namespace" metrics in prometheus going forward. It will appear as a label on prometheus metrics, and you will get an "otel_scope_info" metric if you add scope attributes. But I would encourage us to try to move away from having an additional prefix only for prometheus metrics. I'm working to allow the same names to be used in otel + prometheus in the near future, at which point we should have the exact same names. Edit: Note that i'm not arguing for or against a prefix for the metric. I'm just saying we should use the same name for prometheus and other exporters, rather than having special naming for prometheus. |
I went to look for supporting evidence in the specification for metrics. The way I understand scope name, in any case, is that it is meant to distinguish alternative producers of a set of metric names. The reason I like this proposal, to have a "otelcol" prefix placed into the metric name, not the scope name, is that OTel Collector is the one specifying the interpretation of the metrics. If I want to build my own alternate collector, let's say, with a different mechanism for the The reason to support this issue, that we retain an That is why, in OTEP 238, I propose that we use |
I completely disagree with the name prefix for the same reason we don't want a "cpu.usage" metric to be named "otecol.cpu.usage" and "otelsdk.cpu.usage" those are wrong names in my opinion and we moving backwards from an ideal goal. I still strongly believe that |
@bogdandrutu I would like you to be clear about why you think Neither We specify
In the case of metrics designed to monitor the OpenTelemetry collector, I'm not sure a generic name like "exporter_spans_sent" is specific enough, because any piece of code that exports spans could reasonably use that metric name. I'm specifically looking for metric names that an SDK can emit (how many spans did you export?) which I can compare with metrics that a Collector can emit (how many spans did you export?). In my work on open-telemetry/oteps#238, (which is closed pending further work), I came to recommend that SDKs and Collectors not use the same name even if the task is nearly the same ("exporting spans") for different reasons. Still, the name Further, you didn't respond to this point:
We can instrument an OTC pipeline by integrating with each of the helper libraries, connecting an OTel SDK, and generating metrics using a conventional approach. We leave the scope_name field in the data model free for use so that alternative approaches can generate the same metric names. I might, for example, imagine a single event log written by the collector describing every component invocation, including additional detail not present in the conventional instrumentation. I will be able to process that log and synthesize the same metrics that conventional instrumentation would produce, but I will need to use a different scope name, since a different instrumentation library produced the metrics. |
I'm for the short term solution of adding the |
As discussed on the SIG call on 6-Mar-2024, the concensus that prefixes were better in the short term to be consistent. Additionally, using |
Currently, metrics generated by the collector include the prefix
otelcol
as configured here:opentelemetry-collector/service/internal/proctelemetry/config.go
Line 215 in 8131d31
This is not the case when configuring metrics to be emitted via OTLP, as the prefix configuration is specific to prometheus. I'd like to propose the prefix be applied to the metric names, so that they remain consistent when users switch from one mechanism to another.
The text was updated successfully, but these errors were encountered: