Skip to content

[extension/opamp] Set OpAMP header with collector info #40612

@dpaasman00

Description

@dpaasman00

Component(s)

cmd/opampsupervisor, extension/opamp

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

When a collector connects to an OpAMP server, there should be some information included in the initial HTTP request to help identify the Client to the Server. This initial request is a very basic one and doesn't provide default information to the Server about the Client trying to connect - only headers configured by the user are available right now.

Describe the solution you'd like

I propose specifying a HTTP header by default in the OpAMP extension. I think the "User-Agent" header makes sense for this, and the value can be "OpenTelemetry Collector/[agent-type]/[agent-version]".

Describe alternatives you've considered

The collector's AgentDescription message would provide great information, but this message doesn't come until after the Server has accepted the Client's connection. The Server should be provided enough information on the initial connection request to determine if it wants to accept it. Using the AgentDescription info today would involve the Server accepting the connection request, wait for/request an AgentDescription, and then evaluate and potentially terminate the connection after previously accepting.

Additional context

On top of updating the extension, the supervisor should also be updated to respect the OpAMP headers reported by the collector/extension. Right now the supervisor ignores these and only uses the headers it was configured with. We can merge these giving a preference to those in the supervisor config or those reported by the collector - I don't have a preference here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions