-
Notifications
You must be signed in to change notification settings - Fork 487
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
Add an otelcol.processor.resourcedetection component #5764
Conversation
docs/sources/flow/reference/components/otelcol.processor.resourcedetection.md
Outdated
Show resolved
Hide resolved
// HTTP client settings for the detector | ||
// Timeout default is 5s | ||
// Client otelcol.HTTPClientArguments `river:",squash"` | ||
Timeout time.Duration `river:"timeout,attr,optional"` | ||
//TODO: Uncomment this later? Can we just get away with a timeout, or do we need all the http client settings? | ||
// It seems that HTTP client settings are only used in the ec2 detection via ClientFromContext. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HTTP settings in the Collector expose HTTP client settings for two reasons:
- The timeout is used to cancel resource detections if they take too long. This use case has nothing to do with HTTP at all.
- The ec2 detection uses the HTTP settings if they are provided. This feature is not documented in the OTel docs.
For now I would like to expose just the timeout
parameter:
- This is because it would be super confusing to document
timeout
as both a timeout for HTTP and for ec2. - I'll leave a TODO to implement it in the future.
I wish the OTel Collector worked differently:
- There should be a non-HTTP
timeout
settings for all detectors - There should be HTTP settings specific to the ec2 detector. That way ec2 won't use
context
, and it will be possible to have different HTTP settings for different detectors.
Maybe it'll be work raising these issues with the upstream maintainers.
docs/sources/flow/reference/components/otelcol.processor.resourcedetection.md
Outdated
Show resolved
Hide resolved
.../processor/resourcedetection/internal/resource_attribute_config/resource_attribute_config.go
Show resolved
Hide resolved
This PR has not had any activity in the past 30 days, so the |
4e708de
to
4bb42f6
Compare
docs/sources/flow/reference/components/otelcol.processor.resourcedetection.md
Outdated
Show resolved
Hide resolved
---------------------------------------------- | ------------------------------------------------- | -------- | ||
[resource_attributes](#ec2--resource_attributes) | Configures which resource attributes to add. | no | ||
|
||
##### ec2 > resource_attributes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These ... > resource_attributes
headings have a small weight of ####
so that they don't appear in the ToC. This makes the ToC much cleaner.
docs/sources/flow/reference/components/otelcol.processor.resourcedetection.md
Outdated
Show resolved
Hide resolved
component/otelcol/processor/resourcedetection/resourcedetection.go
Outdated
Show resolved
Hide resolved
Does this provide support for the env resource detector? e.g. setting resource attributes in |
4d855af
to
317b367
Compare
component/otelcol/processor/resourcedetection/internal/openshift/config.go
Show resolved
Hide resolved
ffefa15
to
cf1f371
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some doc suggestions and questions
docs/sources/flow/reference/components/otelcol.processor.resourcedetection.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.resourcedetection.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.resourcedetection.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.resourcedetection.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.resourcedetection.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.resourcedetection.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.resourcedetection.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.resourcedetection.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.resourcedetection.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.resourcedetection.md
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % some nits; I don't mean to block this PR as it's been a large effort, but I have a potential concern about the long-term maintainability of it and whether we could re-think how we configure these blocks and keep track of new options.
GIven that would be a big change in of itself, I'm fine with re-considering in a future PR.
component/otelcol/processor/resourcedetection/internal/aws/ec2/config.go
Show resolved
Hide resolved
component/otelcol/processor/resourcedetection/resourcedetection.go
Outdated
Show resolved
Hide resolved
.../processor/resourcedetection/internal/resource_attribute_config/resource_attribute_config.go
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs look good to me
Co-authored-by: Clayton Cornell <[email protected]>
68d5af3
to
1a3f73f
Compare
🎉 |
* Add a otelcol.processor.resourcedetection component * PR review suggestions * Make k8s API config authentication options const. * Fail validation if an incorrect detector is supplied. * Remove unnecessary Consul attributes. --------- Co-authored-by: Clayton Cornell <[email protected]>
This is a draft PR to port over the resource detection processor. There are a few things which we need to agree on before the PR is taken out of "draft" stage. I will open comments on the specific lines where we need consensus.