-
Notifications
You must be signed in to change notification settings - Fork 851
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
> The resource attributes MAY be copied to labels of exported metric families if required by the exporter configuration #6235
Comments
I see #6179 just got merged. |
Looks like you guys already discussed this: |
@gabrieljones Are you cool with this outcome, or is there something else you're looking for? |
I'd like to avoid using a customizer here. A customizer would require adding code to 10+ different microservices. I have a simple function that turns hocon config into |
//Main.scala
//...
val configRoot: Config = ConfigFactory.load()
val configOpenTelemetry: Config = configRoot.withOnlyPath("otel")
configOpenTelemetry.entrySet().asScala.foreach { e =>
val k = e.getKey
val v = e.getValue.unwrapped().toString
// .- is used to denote properties that share a name with a config object name
// https://github.com/lightbend/config/blob/v1.4.2/HOCON.md#:~:text=there%20is%20an-,intractable%20case,-where%20a%20single
// eg
// `otel.traces.sampler.- = parentbased_traceidratio`
// becomes
// `System.setProperty("otel.traces.sampler", "parentbased_traceidratio")`
val km = k.replaceAll("""\.-$""", "")
System.setProperty(km, v)
}
val openTelemetry: OpenTelemetry = AutoConfiguredOpenTelemetrySdk.builder.build().getOpenTelemetrySdk Result: System.setProoerty("otel.exporter.otlp.endpoint", "https://<otlp inbox>")
System.setProoerty("otel.logs.exporter", "otlp")
System.setProoerty("otel.resource.attributes", "service.namespace=some-namespace,deployment.environment=dev,service.instance.id=some-deployment-78648ffc65-9p8jj,service.cluster=devc,service.version=3.4.1-55758a5")
System.setProoerty("otel.service.name", "some-service-name")
System.setProoerty("otel.metrics.exporter", "prometheus")
|
The system properties and environment variables we interpret in autoconfigure is governed by the specification. There's currently no spec'd environment variable for configuring the prometheus resource attributes. There's a moratorium in place preventing any non-essential environment variable extensions while file configuration is being worked out. Hence, my comment about adding programmatic configuration but not adding environment variable / system property support. |
Given the moratorium I guess this part of the spec is in limbo until file config is finished.
Hardcoding it is then. After #6231 goes in that is. I don't suppose Prometheus allows for creating "views" over join queries?
|
Describe the bug
Prometheus metrics exporter is missing config option to copy resource attributes to labels.
What did you expect to see?
A config option to copy resource attributes to labels on metric families.
https://github.com/open-telemetry/opentelemetry-java/tree/v1.35.0/sdk-extensions/autoconfigure#prometheus-exporter
What did you see instead?
No such config option
What version and what artifacts are you using?
Artifacts:
opentelemetry-sdk-extension-autoconfigure
,opentelemetry-exporter-prometheus
Version: v1.35.0
The text was updated successfully, but these errors were encountered: