Skip to content

[cloudprober.surfacer.prometheus.SurfacerConf] Set global labels via CLI Flag #940

Description

@conallob

Per https://cloudprober.org/docs/config/surfacer/#cloudprober_surfacer_prometheus_SurfacerConf , --prometheus_metrics_prefix can be set to define the prefix of all metrics surfaces to Prometheus.

In addition to defining a prefix, I would like to define some common labels across all probesets in a cloudprober instance.

I can use the additional_labels functionality within a specific probeset, but that will generate a significant amount of boilerplate configuration after a number of probesets.

Instead of having to define the following additional label across every probeset with

  additional_label {
    key: "src_zone"
    value: "{{.zone}}"
  }

or

  additional_label {
    key: "src"
    value: "value"
  }

I would prefer to be able to do:

  • --prometheus_global_label=src_zone={.zone} (or some shorthand to set the label key)
  • --prometheus_global_label=src=value

This would be particularly useful in non Kubernetes environments, where additional metadata needs to be explicitly configured, instead of being detected

Activity

  1. added
    enhancement
    on Nov 26, 2024
  2. conallob commented on Nov 26, 2024

    @conallob
    ContributorAuthor

    I forgot to mention that in the bug report.

    Basically, I want that functionality, but configurable as a CLI flag, instead of an environmental variable.

    Since the environmental variable parsing already exists, could a new contributor plumb it into a flag too? I could offer myself as tribute, now that I've gotten sign off to make contributions on behalf of my employer

  3. added theissue type on Aug 12, 2025
  4. removed
    enhancement
    on Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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