-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
enhancementA general enhancementA general enhancementregistry: otlpOpenTelemetry Protocol (OTLP) registry-relatedOpenTelemetry Protocol (OTLP) registry-relatedspring-boot changeChange is needed in Spring Boot for this issueChange is needed in Spring Boot for this issue
Milestone
Description
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
Line 108 in 029a887
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.
stse, greg-poirier-swi and martinbeentjes
Metadata
Metadata
Assignees
Labels
enhancementA general enhancementA general enhancementregistry: otlpOpenTelemetry Protocol (OTLP) registry-relatedOpenTelemetry Protocol (OTLP) registry-relatedspring-boot changeChange is needed in Spring Boot for this issueChange is needed in Spring Boot for this issue