Skip to content

labels from prometheus-plugin-prometheus-sd configcontext #233

@rvmack

Description

@rvmack

Hi there,

I'd like to override scrape_interval and scrape_timeout as needed via config context without modifications on prometheus server config.
In the end I want to set __scrape_timeout__ and __scrape_interval__ labels. Guess there'd be lot more use cases.

As far as I can see, that'd just require some additional code here:
https://github.com/FlxPeters/netbox-plugin-prometheus-sd/blob/main/netbox_prometheus_sd/api/utils.py#L162

@FlxPeters would you agree a MR in that regard? Like exposing all labels below "labels" key in a prometheus-plugin-prometheus-sd config context:

"prometheus-plugin-prometheus-sd": [
        {
            "metrics_path": "/smth",
            "port": 1234,
            "scheme": "https",
            "labels": {
               "k": "v"
            }
        }
    ]

if key "k":

  • does not start with __meta_netbox_
  • is not eqal to __scheme__ or __metrics_path__

These conditions shall prevent conflicts with existing stuff.

Thanks for sharing this plugin!

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