-
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
Tracking issue for confmap.strictlyTypedInput
feature gate
#10552
Comments
…10553) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description <!-- Issue number if applicable --> Adds coda to errors related to `confmap.strictlyTypedInput` that direct users to #10552 and explain the feature gate. #### Link to tracking issue Updates #9532 <!--Describe what testing was performed and which tests were added.--> #### Testing Tests that the coda is present when there are weakly typed errors and not present with non weakly-typed errors. <!--Describe the documentation added.-->
…version (#34043) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Adds a hint like this to `api_version`: ``` Hint: You may want to wrap the 'api_version' value in quotes (api_version: "1.25") ``` **Testing:** <details> <summary>docker_stats config and output</summary> #### Config ```yaml receivers: docker_stats: collection_interval: 2s api_version: 1.25 # Floating value exporters: nop: service: pipelines: metrics: receivers: [docker_stats] exporters: [nop] ``` #### Output ``` Error: failed to get config: cannot unmarshal the configuration: 1 error(s) decoding: * error decoding 'receivers': error reading configuration for "docker_stats": 1 error(s) decoding: * 'api_version' expected type 'string', got unconvertible type 'float64', value: '1.25'. Hint: You may want to wrap the 'api_version' value in quotes (api_version: "1.25") Hint: Temporarily restore the previous behavior by disabling the `confmap.strictlyTypedInput` feature gate. More details at: open-telemetry/opentelemetry-collector#10552 ``` </details> <details> <summary>docker_observer config and output</summary> ```yaml receivers: nop: exporters: nop: extensions: docker_observer: api_version: 1.25 service: extensions: [docker_observer] pipelines: metrics: receivers: [nop] exporters: [nop] ``` ``` Error: failed to get config: cannot unmarshal the configuration: 1 error(s) decoding: * error decoding 'extensions': error reading configuration for "docker_observer": 1 error(s) decoding: * 'api_version' expected type 'string', got unconvertible type 'float64', value: '1.25'. Hint: You may want to wrap the 'api_version' value in quotes (api_version: "1.25") Hint: Temporarily restore the previous behavior by disabling the `confmap.strictlyTypedInput` feature gate. More details at: open-telemetry/opentelemetry-collector#10552 ``` </details>
I observe a breaking change with this newly introduced behavior. After the feature gate was turned on, grafana_cloud integrations via
As grafana cloud usernames are often integers, seems like users running this setup with docker without hardcoding credentials might experience unexpected errors. One of the workarounds I see could be using Here is a minimal example which allows reproducing the error: docker-compose.yaml
.secrets
otel-collector-config.yaml
|
Not sure if relevant, but would note that my setup for this is:
An actual example that I'm running could be found here (just remove |
#10618 will fix this, in the mean time you can revert the feature gate |
Btw. I get the same error twice within this section:
|
@Kuckkuck your configuration is wrong. transform/containerd:
log_statements:
- context: log
statements:
- ... |
This is not specific to this error, it happens for all errors: you get the error once in the logs and another in stdout. |
same issue for
|
@cforce |
Just came across of what I believe to be a side-effect of this issue. On a config like this: extensions:
zpages: {}
basicauth/otlp:
client_auth:
username: "${OTLP_USER}"
password: "${GRAFANA_ACCESS_TOKEN}" The collector will fail to start if
Forcing this to a string in YAML as @TylerHelmuth suggested here extensions:
zpages: {}
basicauth/otlp:
client_auth:
username: str!! "${OTLP_USER}" # Force YAML decoder to read it as a string.
password: "${GRAFANA_ACCESS_TOKEN}" EDIT: I don't think the above is working. I think it is taking Using
@TylerHelmuth Is there something I'm doing wrong here? |
@roobre Thanks for the report. What version are you using? Would you mind trying with the latest version (v0.106.1) if you haven't done so already? |
@mx-psi Thanks for taking a look! I'm on |
@roobre do you have then |
@TylerHelmuth I don't think I'm setting that to any particular value, so I presume it should be set to whatever the default is. Am I expected to have to modify it for the snippet above to work as it used to? |
@roobre, @mx-psi found what the issue is. the expandconverter is taking our struct type (that handles using the string representation of the int when the value is used in a string field), getting the original int value from it, and using that in the map instead. The fix is the get rid of the expandconverter, which has been our plan all along. Keep an eye out for the |
@TylerHelmuth That's awesome, thank you! |
I observe an I am declaring an environment variable in I am getting the following error unless I:
Is there some other construction I should use to be able to supply the Here is a minimal example which allows reproducing the error: docker compose up --build output
.env
docker-compose.yaml
otel-collector-config.yaml
|
@aheusser Thanks for your comment! We are in the process of releasing v0.107.0, I will let you know once this is released (I think it should solve your issue) |
@aheusser v0.107.0 is out! |
@mx-psi I think my initial validation test a few hours ago (which seemed to suggest that v0.107.0 resolved my previously-reported problem) was an invalid test in some way. After starting fresh again just now, I am now getting the same problem ( |
I have similar issue with my processor below. experimental_metricsgeneration/ucp_internal_cpu_percent: I got error message "'rules[0].unit' expected type 'string', got unconvertible type 'int', value: '1'". For percentage, the recommended and default unit is 1. Should I change the unit or is this also a bug of confmap.strictlyTypedInput? |
@aheusser Thanks for reaching out. I think I understand why this is happening. Our current test suite did not catch this, and we will likely need end to end tests. I filed #10897 to fix this and add one initial test that catches this.
@JaneCui This is not a bug, you should put |
Thank you for your diligence @mx-psi I will test again once available. |
@mx-psi I think I might be hitting this again in
I have tried with both extensions:
zpages: {}
basicauth/otlp:
client_auth:
username: !!str "${OTLP_USER}"
password: "${GRAFANA_ACCESS_TOKEN}" And extensions:
zpages: {}
basicauth/otlp:
client_auth:
username: "${OTLP_USER}"
password: "${GRAFANA_ACCESS_TOKEN}" And also with Where again, the |
…ions (#10897) #### Description The custom unmarshalling for components copied a map without preserving the internal representation. This led to the issues mentioned on #10552 not being fully fixed (they were only fixed if they happened in the `service::telemetry` section for example). #### Link to tracking issue Fixes issues mentioned on #10552 #### Testing This adds one unit test at the `otelcol` level. Since we didn't catch this with our current `confmap/internal/e2e` tests, we likely also want to refactor those. --------- Co-authored-by: Dmitrii Anoshin <[email protected]> Co-authored-by: Curtis Robert <[email protected]> Co-authored-by: Alex Boten <[email protected]>
Thanks @mx-psi! The problem got solved after I change to unit: "1". |
I have a question for these changes. I'm upgrading the version from 0.97.0 to 0.108.0. I changed the env var values:
"failed to build pipelines: failed to create "resource/md" processor, in pipeline "logs/stream/ltm": error creating AttrProc. Either field "value", "from_attribute" or "from_context" setting must be specified for 0-th action Do you know how I can fix it? |
@yanamg7 What version of the Collector are you using and how? What is your full config? (please remove any sensitive details before sharing!) |
This appears to still be an issue when running the latest image
|
@kairos-samantha please open a new issue with details about your situation. |
This issue describes the
confmap.strictlyTypedInput
feature gate, intended to address #8565 and #9532.What is changing?
field: ${env:ENV}
) for string-typed fields will use the value passed inENV
verbatim without intermediate type casting.What does it mean to me?
Starting on v0.105.0, you may have to adapt your configuration to use the correct type on some fields. This should be a straightforward. You are able to skip the error and update your configuration at your own pace by disabling the
confmap.strictlyTypedInput
feature gate.Please reply below if:
Changelog
The text was updated successfully, but these errors were encountered: