Skip to content

Kubernetes SD: Optionally attach namespace and node metadata to targets #9510

@rfratto

Description

@rfratto

Proposal

Kubernetes SD should be extended so the service, pod, endpoints, and ingress roles can optionally attach extra meta labels based on the namespace and node objects that the targets are discovered in (where appropriate; ingress wouldn't support node meta labels, etc.).

This could be used within Prometheus, but also within Grafana Agent (for traces) and Promtail (for logs) to use this new meta information in similar ways.

Use case. Why is this important?
There are a few use cases for where this would be useful. One such use case has been documented in grafana/agent#980.

Another use case is for filtering targets to scrape to those that exist within specific namespaces. In this scenario, managed namespaces are dynamically created on behalf of users where they have full control over the resources deployed in the environment. The namespace, which users do not have permissions to modify, would have labels or annotations that determine whether scraping is available. This makes checking labels/annotations on the pods inappropriate as users have full control over their contents.

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