Skip to content

Feature: Do not overwrite metric labels by server group labels if present #727

@FUSAKLA

Description

@FUSAKLA

Hi, I'd like to propose a feature to disable overwriting labels of metric by the specified labels of server group.

The reason for this is I use it as an alternative to external_labels of Prometheus. BUT those do not overwrite the label if metrics already has it.

Off course, I don't expect the behavior as is to change, that would be a breaking change, instead I'm thinking about adding some option like labels_do_not_overwrite: <bool> with default to false

The particular code is here if I'm not mistaken, where it should be sufficient to check if the label is there and if so to continue

func ValueAddLabelSet(a model.Value, l model.LabelSet) error {

I'd be happy to send a PR if we agree on the implementation.

Thanks for consideration in advance!
Also for the project at all :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions