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

[processor/resourcedetection] New dimension host.id was added enabled by default #21233

Closed
atoulme opened this issue Apr 27, 2023 · 12 comments · Fixed by #24010
Closed

[processor/resourcedetection] New dimension host.id was added enabled by default #21233

atoulme opened this issue Apr 27, 2023 · 12 comments · Fixed by #24010
Labels
bug Something isn't working processor/resourcedetection Resource detection processor

Comments

@atoulme
Copy link
Contributor

atoulme commented Apr 27, 2023

Component(s)

processor/resourcedetection

What happened?

Description

With #18618, we added a new dimension host.id and it was marked enabled by default. Unfortunately, this conflicts with our own detectors and is causing issues.

We would like to make sure this dimension is not enabled by default and going forward that we make sure any data change is considered as not default to avoid surprises.

Collector version

0.75.0

Environment information

No response

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@atoulme atoulme added bug Something isn't working needs triage New item requiring triage labels Apr 27, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 27, 2023

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@atoulme atoulme removed receiver/hostmetrics needs triage New item requiring triage labels Apr 27, 2023
@mx-psi
Copy link
Member

mx-psi commented Apr 28, 2023

I would argue that adding things enabled by default has been the usual practice for the resource detection processor. Other examples can be seen in #12914 and #12355. I think we should not freeze the set of attributes added by a given detector by default until we deem the detector stable, and we have not done (to my knowledge) any analysis of whether the system detector or any others are stable enough.

I think a better option until such stability is reached is to use the functionality added in #8547 if you want to freeze the set of attributes added by the processor.

@atoulme
Copy link
Contributor Author

atoulme commented May 2, 2023

@mx-psi this change caused inadvertent change and I think we ought to have some functional test coverage to make sure we understand how cascading detectors may inadvertently impact each other. We can cover that with a test and just make sure we report if the behavior has changed as a breaking change so folks downstream (👋 ) can do the right thing and not run into surprises.

@dmitryax
Copy link
Member

dmitryax commented May 3, 2023

I submitted #21482 which should help us to avoid issues like this going forward

@mx-psi
Copy link
Member

mx-psi commented May 4, 2023

make sure we report if the behavior has changed as a breaking change

That makes sense to me :)

@mx-psi
Copy link
Member

mx-psi commented Jun 28, 2023

Now that #23253 has landed, should we mark host.id as enabled: false on the system detector and mark it as a breaking change?

@mx-psi
Copy link
Member

mx-psi commented Jul 6, 2023

Filed #24010 for this

@sumo-drosiek
Copy link
Member

this conflicts with our own detectors and is causing issues.

What does mean our own detectors? hostmetricsreceiver?

@mx-psi
Copy link
Member

mx-psi commented Jul 6, 2023

I am not sure what @atoulme meant, but I think an example where things could break for users is the following:

processors:
  resourcedetection:
    detectors: [system, ec2]

If we are on EC2, then:

  1. Before v0.72.0, host.id would have the EC2 instance id
  2. After v0.72.0, host.id would have the machine id (from e.g. /etc/machine-id)

Ultimately the issue here is that host.id has multiple meanings that are all valid on the same host. Before v0.72.0 one could use the presence of other attributes (e.g. cloud.provider or cloud.platform) to determine which of the two meanings (EC2 instance id or machine id) was the one set here, but v0.72.0 broke that. I feel like this is an issue at the spec level, but until we fix that at the spec restoring the old behavior sounds better to me.

@sumo-drosiek
Copy link
Member

Shouldn't the solution be to disable host.id by default for all detectors?
It is easy to go into this conflict on the other way around just by reordering detectors

@mx-psi
Copy link
Member

mx-psi commented Jul 10, 2023

@sumo-drosiek My main point in having host.id enabled on ec2 but not in system is backwards compatibility, since that's the way it has been for a long time. I think it can be okay to have host.id disabled on every detector (I haven't thought too closely about it), but I would like to do that on a separate step if we go that way

@sumo-drosiek
Copy link
Member

My main point in having host.id enabled on ec2 but not in system is backwards compatibility, since that's the way it has been for a long time.

Thanks for clarification 🙏

mx-psi added a commit that referenced this issue Jul 17, 2023
…efault (#24010)

**Description:** 

Disable setting `host.id` by default on the `system` detector.
Users can restore the previous behavior by setting
`system::resource_attributes::host.id::enabled` to `true`.

**Link to tracking Issue:** Fixes #21233

**Testing:** Amended existing tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working processor/resourcedetection Resource detection processor
Projects
None yet
4 participants