Aiven-Open / prometheus-exporter-plugin-for-opensearch

Prometheus exporter plugin for OpenSearch & OpenSearch Mixin
Apache License 2.0
129 stars 37 forks source link

Can I add custom labels to metrics collection? #298

Open 10000-ki opened 3 months ago

10000-ki commented 3 months ago

Depending on the user-defined Grafana dashboard, various filtering may be necessary.

It would be ideal to have a structure where custom labels can be appropriately registered as needed.

For example, it would be ideal if labels could be registered in a key-value format like the following

- job_name: opensearch
  scrape_interval: 10s
  metrics_path: "/_prometheus/metrics"
  static_configs:
  - labels:
    - env: prod
    - key2: value2
    - key3: value3
    - ...

https://github.com/Aiven-Open/prometheus-exporter-plugin-for-opensearch/blob/486ca19752c2016895d269da9c0f0d5fd7b5820c/src/main/java/org/compuscene/metrics/prometheus/PrometheusMetricsCollector.java#L164

10000-ki commented 1 month ago

@lukas-vlcek hi! Could you please consider this?