Skip to content

Monitor Services using annotations #135

Answered by julianfbeck
julianfbeck asked this question in Q&A
Discussion options

You must be logged in to vote

Never mind, I figured it out using the additional crape config (y) and adding:

- job_name: kubernetes-service-endpoints
  kubernetes_sd_configs:
    - role: endpoints
  relabel_configs:
    - action: keep
      regex: true
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_scrape
    - action: replace
      regex: (https?)
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_scheme
      target_label: __scheme__
    - action: replace
      regex: (.+)
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_path
      target_label: __metrics_path__
    - action: replace
      regex: ([^:]+)(?::\d+)?;(\d+)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by julianfbeck
Comment options

You must be logged in to vote
1 reply
@McMac
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants