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 Answer 1

1

Found this solution:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.