Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
Renaming metrics in service monitor

after reading this article I'm trying to cleanup metrics going out of Spark 3.0.1. Here is my servicemonitor.yml file:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  labels:
    app: spark3
    release:  prometheus
  name: spark3-servicemonitor
spec:
  endpoints:
  - interval: 5s
    port: spark-ui
    path: /metrics/prometheus
    relabelings:
    # Rename metrics
      - sourceLabels: [__name__]
        targetLabel: __name__
        regex: 'metrics_spark_driver_.+_StreamingMetrics_([a-zA-Z_]{1,})_Value'
        replacement: 'spark_driver_$1'
  namespaceSelector:
    matchNames:
    - default
  selector:
    matchLabels:
      spark-version: "3"

I expect the following transformation: metrics_spark_driver_whateverappid_StreamingMetrics_streaming_lastCompletedBatch_totalDelay_Value -> spark_driver_streaming_lastCompletedBatch_totalDelay however the relabelling does not seem to work. Could you please assist me on this subject?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The relabelings must be named metricRelabelings according to the spec. Note that the yaml format of the ServiceMonitors does not use the same key names as the corresponding prometheus config (but it is still valid yaml).

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!