Closed
Description
Component(s)
extension/observer
Describe the issue you're reporting
Enhancement request
Expose host
and port
in the endpoint's Env()
, instead of relying on endpoint
alone.
Context/Why
The endpoint's Env
is used to allow the receiver creator to dynamically set configuration options for a receiver being created.
I'm filing this as a result of a receiver requiring the host (or IP address) to be configured independently from a port. From documentation, the exposed endpoint
will sometimes also include the port. See #33560 for the specific receiver details.
Alternative approaches
- Leave
endpoint
exposed as-is, and require receivers to be compatible with this. This forces receivers into a specific configuration and would require potentially breaking changes to make it work. I believe this would be too impactful on receivers to enforce. - Pass in golang's regexp as an argument to
Env
. The receiver creator is using the expr-lang pkg to parse and evaluate arguments, which can accept golang types as environment variables. Passing in regexp would allow users to operate onEnv
contents using regular expressions, and parsing out the host and port manually in configuration. This would be a complicated UX, and also would more fully tie the receiver creator toexpr-lang
.