Skip to content

Add namespace selecting header #16201

Closed
Closed
@mamari90

Description

@mamari90

When using OTEL collector to send data to APM it would be helpful to have the possibility to choose the elastic namespace where to save the data (traces, logs and metrics).
In my scenario we use a single cluster to handle the data of multiple environments or sets of applications, and being able to change the namespace used will allow me to fine tune the RBAC on those indices, avoiding security problems.

Proposal:
This could be done using a custom header set on the otel exporter configuration, so that the otel collector on a (let's say) k8s cluster could sent data to a namespace, and another collector on another cluster will send them to a different namespace

extraction of otel configuration

    exporters:
      logging:
        loglevel: warn

      otlphttp/elastic:
        tls:
          insecure: true
        endpoint: "${apm_endpoint}"
        headers:
          Authorization: "ApiKey ${apm_api_key}"
          X-Apm-Namespace: "my.namespace" # APM server will use this value if defined

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