Skip to content

Support configurable list of metadata_keys that can be used to set client address #14186

@isaacaflores2

Description

@isaacaflores2

Component(s)

No response

Is your feature request related to a problem? Please describe.

Currently both confighttp and configgrpc set the client address based only one value RemoteAddress or peer address respectively

  1. confighttp: https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/confighttp/clientinfohandler.go#L34
  2. configgrpc: https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configgrpc/configgrpc.go#L591

In some cases the clients may not set RemoteAddress or peer or a specific environment may require deriving the client address from other request information.

Describe the solution you'd like

Expose a list of metdata_keys (headers) that can be used to determine the client address.
The first valid key value can be used to set the client.Address. An example would be checking the following keys in order: x-forwarded-for, x-real-ip and using the first valid ip.

Describe alternatives you've considered

No response

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions