Skip to content

OTLP registry custom header support #3546

@stse

Description

@stse

Please describe the feature request.
Provide configuration properties to provide custom headers e.g. API-Key which are sent whenever metrics are posted to the OTLP endpoint.

Having something like this

management:
  otlp:
    metrics:
      export:
        step: 1s
        url: https://otlp.eu01.nr-data.net/v1/metrics
        headers:
          API-Key: otlp-endpoint-api-key

so that these headers are sent with each request may be this way

var builder = this.httpSender.post(this.config.url());
for (final var header : this.config.headers()) {
  builder = builder.withHeader(header.key(), header.value());
}
builder.withContent("application/x-protobuf", request.toByteArray()) .send();

see

this.httpSender.post(this.config.url()).withContent("application/x-protobuf", request.toByteArray())

Another solution would be to use the Open Telemetry SDK and allow to provide custom MetricExporter beans. This works very well already for tracing. Here I can provide custom SpanExporter beans.

Rationale
Having direct OTLP support is great but in order to connect with some OTLP endpoints, e.g. NewRelics OTLP endpoints a header containing an API key has to be sent with each request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementA general enhancementregistry: otlpOpenTelemetry Protocol (OTLP) registry-relatedspring-boot changeChange is needed in Spring Boot for this issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy