You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Between versions v0.31.0 and v0.32.0, the attributes from the default resource changed their behavior.
Environment
OS: Linux
Architecture: amd64
Go Version: 1.10
opentelemetry-go version:v0.31.0 -> v0.32.0
Steps To Reproduce
git checkout metric/v0.31.0
cd example/prometheus && go run main.go
See the output of loalhost:2222/metrics
Do the same with metric/v0.32.0 and compare the third bullet step output.
Expected behavior
The v0.31.0 version outputs:
# HELP ex_com_one
# TYPE ex_com_one gauge
ex_com_one{A="1",B="2",C="3",ex_com_lemons="10",service_name="unknown_service:main",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.8.0"} 1
# HELP ex_com_three
# TYPE ex_com_three counter
ex_com_three{A="1",B="2",C="3",ex_com_lemons="10",service_name="unknown_service:main",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.8.0"} 12
# HELP ex_com_two
# TYPE ex_com_two histogram
ex_com_two_bucket{A="1",B="2",C="3",ex_com_lemons="10",service_name="unknown_service:main",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.8.0",le="1"} 0
ex_com_two_bucket{A="1",B="2",C="3",ex_com_lemons="10",service_name="unknown_service:main",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.8.0",le="2"} 0
ex_com_two_bucket{A="1",B="2",C="3",ex_com_lemons="10",service_name="unknown_service:main",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.8.0",le="5"} 1
ex_com_two_bucket{A="1",B="2",C="3",ex_com_lemons="10",service_name="unknown_service:main",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.8.0",le="10"} 1
ex_com_two_bucket{A="1",B="2",C="3",ex_com_lemons="10",service_name="unknown_service:main",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.8.0",le="20"} 1
ex_com_two_bucket{A="1",B="2",C="3",ex_com_lemons="10",service_name="unknown_service:main",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.8.0",le="50"} 1
ex_com_two_bucket{A="1",B="2",C="3",ex_com_lemons="10",service_name="unknown_service:main",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.8.0",le="+Inf"} 1
ex_com_two_sum{A="1",B="2",C="3",ex_com_lemons="10",service_name="unknown_service:main",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.8.0"} 2
ex_com_two_count{A="1",B="2",C="3",ex_com_lemons="10",service_name="unknown_service:main",telemetry_sdk_language="go",telemetry_sdk_name="opentelemetry",telemetry_sdk_version="1.8.0"} 1
So we see the service_name, telemetry_sdk_language, and other default attributes from the default resource.
When running in v0.32.0:
# HELP bar a fun little gauge
# TYPE bar counter
bar{A="B",C="D"} 75
# HELP baz a very nice histogram
# TYPE baz histogram
baz_bucket{A="B",C="D",le="0"} 0
baz_bucket{A="B",C="D",le="5"} 0
baz_bucket{A="B",C="D",le="10"} 1
baz_bucket{A="B",C="D",le="25"} 1
baz_bucket{A="B",C="D",le="50"} 0
baz_bucket{A="B",C="D",le="75"} 0
baz_bucket{A="B",C="D",le="100"} 0
baz_bucket{A="B",C="D",le="250"} 2
baz_bucket{A="B",C="D",le="500"} 0
baz_bucket{A="B",C="D",le="1000"} 0
baz_bucket{A="B",C="D",le="+Inf"} 4
baz_sum{A="B",C="D"} 236
baz_count{A="B",C="D"} 4
# HELP foo a simple counter
# TYPE foo counter
foo{A="B",C="D"} 5
We don't see the attributes of the default resource.
I'm unsure if this is a bug or an undocumented change. If isn't a bug, which is the right way to add the original default resource?
The text was updated successfully, but these errors were encountered:
The old way of adding those labels to every metric was indeed a bug. It is specifically called out as something that MUST NOT be done in the specification:
In SDK Prometheus (pull) exporters, resource attributes SHOULD be converted to a single target_info metric; otherwise, they MUST be dropped, and MUST NOT be attached as labels to other metric families. The target_info metric MUST be an info-typed metric whose labels MUST include the resource attributes, and MUST NOT include any other labels. There MUST be at most one target_info metric exposed on an SDK Prometheus endpoint.
It seems like a good addition to add a target_info metric to expose the resource information in the exporter.
@Aneurysm9
I have talked with @paivagustavo in slack and found that he has already completed the coding of this pr, since this is duplicate of #3166.
Could you assign this work to @paivagustavo?
Description
Between versions v0.31.0 and v0.32.0, the attributes from the default resource changed their behavior.
Environment
Steps To Reproduce
git checkout metric/v0.31.0
cd example/prometheus && go run main.go
loalhost:2222/metrics
Do the same with
metric/v0.32.0
and compare the third bullet step output.Expected behavior
The v0.31.0 version outputs:
So we see the
service_name
,telemetry_sdk_language
, and other default attributes from the default resource.When running in v0.32.0:
We don't see the attributes of the default resource.
I'm unsure if this is a bug or an undocumented change. If isn't a bug, which is the right way to add the original default resource?
The text was updated successfully, but these errors were encountered: