Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upkubernetes prometheus.io/path is not changing metric path in service endpoint. #4717
Comments
This comment has been minimized.
This comment has been minimized.
|
Hi, it should be It makes more sense to ask questions like this on the prometheus-users mailing list rather than in a GitHub issue. On the mailing list, more people are available to potentially respond to your question, and the whole community can benefit from the answers provided. |
gouthamve
closed this
Oct 11, 2018
This comment has been minimized.
This comment has been minimized.
|
Thanks @gouthamve |
lock
bot
locked and limited conversation to collaborators
Apr 9, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
vishksaj commentedOct 10, 2018
•
edited
What did you do?
Annotations configured for my service
What did you expect to see?
As per relabel config the service endpoint should be /exporter
What did you see instead?
metrics_path is still /metrics (default)
Environment
Prometheus 2.4.2
c305ffa inside kubernetes.
I can see my cutom path in __meta_kubernetes_service_annotation_prometheus_io_path
Prometheus.yml
#my global config
global:
external_labels:
monitor: k8s-incluster
scrape_configs:
scrape_interval: 30s
scrape_timeout: 30s
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
relabel_configs:
action: keep
regex: true
action: replace
target_label: metrics_path
regex: (.+)
action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
target_label: address
action: replace
target_label: scheme
regex: (https?)
regex: _meta_kubernetes_service_label(.+)
action: replace
target_label: kubernetes_namespace
action: replace
target_label: kubernetes_name
metric_relabel_configs:
replacement: '$1'
action: replace
target_label: container_name
replacement: '$1'
action: replace
target_label: pod_name
regex: '([^-]+)-([^-]+)-(.*)'
replacement: '$1'
target_label: app
regex: '([^-]+)-([^-]+)-(.*)'
replacement: '$2'
target_label: app_env
regex: '([^-]+)-([^-]+)-(.*)'
replacement: '$3'
target_label: cluster_id