Skip to content

Add metric enrichment #4017

@ArkovKonstantin

Description

@ArkovKonstantin

Community component name

prometheus.enrich

Community component maintainer

  • I agree to be a maintainer for this component.

Community component description

This issue proposes the addition of a new component prometheus.enrich. The component will provide functionality to enrich metric data with additional labels based on matching labels. This will enable users to inject metadata (such as region, environment, or team ownership) into metrics, directly within Alloy's pipeline.

The behavior of prometheus.enrich will closely resemble the existing loki.enrich component, which performs label enrichment in the logs pipeline. Just as loki.enrich allows label injection based on static configuration or service discovery metadata, the proposed component aims to offer similar enrichment capabilities for metrics.

Also this component builds on architectural directions already discussed in this comment

Motivation

Currently, Alloy provides support for label manipulation via prometheus.relabel, which is primarily focused on transforming existing labels. However, commonly required the ability to:

  • Inject additional metadata (e.g., region, team, environment)

  • Enrich metrics from sources with minimal labeling (e.g., node exporters, custom agents)

  • Support multi-tenant environments where extra context is necessary for alerting and dashboards

At present, these tasks often require external tools or post-processing in storage layers, which increases complexity and latency. Adding enrichment functionality directly in Alloy simplifies architecture, improves observability, and enables more powerful metric routing and filtering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalA proposal for new functionality.

    Type

    No type

    Projects

    Status

    Incoming

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions