1

I have static config in prometheus.yml

  - job_name: 'myjob'
    static_configs:
      - targets: ['monitoring.api.endpoint.net']

And I recieve various metrics for example cpu_usage, disk_write_ops, etc. Is it possible to put them all into namespace like compute_cpu_usage with relabel tool?

1 Answers1

1

Found this solution:

static_configs:
  - targets: ['monitoring.api.endpoint.net']
metric_relabel_configs:
- source_labels: [__name__]
  regex: '(.*)'
  replacement: 'compute_${1}'
  target_label: __name__