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
In our setup we use the VERSION environment variable to set a dimension on metrics, so we can query our metrics based on the version of the application.
The version is sourced in the environment variables and consists of a combination of numbers and letters.
It has come to our attention that in a newer version (v109) the spanmetrics connector does not allow a default of only digits to be set.
Similarly, if there are only digits and the letter e, it will try to decode the value as a float.
For this problem I went ahead and opened a bug report in the spanmetrics project: open-telemetry/opentelemetry-collector-contrib#36786 - however, there it was suggested that the actual problem is probably in the confmap component.
Error: failed to get config: cannot unmarshal the configuration: decoding failed due to the following error(s):
error decoding 'connectors': error reading configuration for"spanmetrics": decoding failed due to the following error(s):
'dimensions[0].default' expected type'string', got unconvertible type'float64', value: '1.23e+06'
2024/12/11 15:45:40 collector server run finished with error: failed to get config: cannot unmarshal the configuration: decoding failed due to the following error(s):
error decoding 'connectors': error reading configuration for"spanmetrics": decoding failed due to the following error(s):
'dimensions[0].default' expected type'string', got unconvertible type'float64', value: '1.23e+06'
Additional context
No response
The text was updated successfully, but these errors were encountered:
Hi @mx-psi, thanks for reaching out.
I'm not 100% sure, but I think changing the config to:
default: '!!str ${VERSION}'
would simply set the version number to the actual string: !!str ${VERSION}
I've done a test with a config without the quotes: default: !!str ${VERSION}
but this is not accepted in both 109 and 115.
I have the feeling it might have something to do with the extracting the environment variable..
I've found that this config is only a "default" that is used when the gitHash property is not available.
Funnily enough, our Spans always have the gitHash attribute already.
The workarond was dead simple: not use a default.
What happened?
Description
In our setup we use the VERSION environment variable to set a dimension on metrics, so we can query our metrics based on the version of the application.
The version is sourced in the environment variables and consists of a combination of numbers and letters.
It has come to our attention that in a newer version (v109) the spanmetrics connector does not allow a default of only digits to be set.
Similarly, if there are only digits and the letter
e
, it will try to decode the value as a float.For this problem I went ahead and opened a bug report in the spanmetrics project: open-telemetry/opentelemetry-collector-contrib#36786 - however, there it was suggested that the actual problem is probably in the
confmap
component.A related issue: #10552
I have not found a way to force the environment variable to be interpreted as a string value.
Steps to Reproduce
I've created a minimal setup in a public repo: https://github.com/timbeemster/otelcol-custom/blob/main/README
Build the docker image and run the setup.
Expected Result
A running otel collector
Actual Result
Error message on startup (see log output section)
Let me know if I can assist in debugging the problem.
Collector version
v0.109.0
Environment information
Environment
OS: Golang base image for building + Debian12 (distroless variant for running)
Compiler(if manually compiled): golang:1.23.2
(see: https://github.com/timbeemster/otelcol-custom/blob/main/Dockerfile )
OpenTelemetry Collector configuration
Log output
Additional context
No response
The text was updated successfully, but these errors were encountered: