1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00
Files
opentelemetry-go/exporters/prometheus/testdata/custom_resource.txt
T
Robert Pająk 69f189f0b6 prometheus: Add otel_scope_schema_url and otel_scope_[attribute] labels (#5947)
Fixes https://github.com/open-telemetry/opentelemetry-go/issues/5846

Towards
https://github.com/open-telemetry/opentelemetry-specification/issues/4223
(first two points from
https://github.com/open-telemetry/opentelemetry-specification/issues/4223#issuecomment-2839595942)

- Add instrumentation scope schema URL as `otel_scope_schema_url` label
to exported metrics
- Add instrumentation scope attributes as `otel_scope_[attribute]`
labels to exported metrics

Side notes:

- The exporter does not seem to work correctly if the end user adds e.g.
an `otel_scope_name` attribute. I think the exporter should ignore all
attributes with names that have prefix `otel_scope_`. This scenario is
also not covered by the spec. I think it may be covered by a separate PR
and issue.
- Removal of `otel_scope_info` metric would be handled as a separate PR.
https://github.com/open-telemetry/opentelemetry-go/pull/6770
2025-05-24 19:35:21 +02:00

10 lines
597 B
Plaintext
Executable File

# HELP foo_total a simple counter
# TYPE foo_total counter
foo_total{A="B",C="D",E="true",F="42",otel_scope_fizz="buzz",otel_scope_name="testmeter",otel_scope_schema_url="",otel_scope_version="v0.1.0"} 24.3
# HELP otel_scope_info Instrumentation Scope metadata
# TYPE otel_scope_info gauge
otel_scope_info{fizz="buzz",otel_scope_name="testmeter",otel_scope_version="v0.1.0"} 1
# HELP target_info Target metadata
# TYPE target_info gauge
target_info{A="B",C="D","service.name"="prometheus_test","telemetry.sdk.language"="go","telemetry.sdk.name"="opentelemetry","telemetry.sdk.version"="latest"} 1