forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore][exporter/datadog] Only start
hostmetadata.Reporter
if `host…
…_metadata.enabled` (open-telemetry#36669) #### Description This PR avoids creating an `inframetadata.Reporter` and starting the metadata-sending goroutine when `host_metadata.enabled` is `false`, and removes some code that was used to work around the previous behavior. See tracking issue for context. When `enabled` is `false`, we leave the `exporter.metadataReporter` field as `nil`. The parts of the code accessing this field were already gated behind `enabled: true`, or `only_metadata: true` (which, in a valid config, implies `enabled: false`), so it should not cause issues. However, tests that modify the config after the exporter is created, or which manually create invalid `Config` structs may encounter segfaults. I assumed we do not mind segfaults in cases of incorrect internal use, and fixed the one test that was failing because of this. #### Link to tracking issue Fixes open-telemetry#36522
- Loading branch information
1 parent
54c2a24
commit 48cc95d
Showing
4 changed files
with
30 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters