Skip to content
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

[extension/observer/docker, receiver/dockerstats] Add hint about api_version #34043

Merged
merged 5 commits into from
Jul 15, 2024

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented Jul 11, 2024

Description:

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:

docker_stats config and output

Config

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:
      https://github.com/open-telemetry/opentelemetry-collector/issues/10552
docker_observer config and output
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:
      https://github.com/open-telemetry/opentelemetry-collector/issues/10552

@mx-psi mx-psi added the release:blocker The issue must be resolved before cutting the next release label Jul 12, 2024
@mx-psi mx-psi marked this pull request as ready for review July 12, 2024 15:37
@mx-psi mx-psi requested a review from a team July 12, 2024 15:37
@mx-psi mx-psi requested a review from MovieStoreGuy as a code owner July 12, 2024 15:37
@atoulme
Copy link
Contributor

atoulme commented Jul 14, 2024

The changes look ok, but wouldn't you like to add a unit test for them as well?

@mx-psi
Copy link
Member Author

mx-psi commented Jul 15, 2024

The changes look ok, but wouldn't you like to add a unit test for them as well?

Yes, but to do that easily I have to merge #34055 first

@mx-psi mx-psi merged commit 6279b7e into open-telemetry:main Jul 15, 2024
154 checks passed
@github-actions github-actions bot added this to the next release milestone Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension/observer receiver/dockerstats release:blocker The issue must be resolved before cutting the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants