Score:0

Prometheus Server not showing Cadvisor metrics for apiserver node

us flag

I have deployed a prometheus helm chart on my Microk8s and all is working fine. The only problem I am having is that it does not seem to be polling metrics for the leader node with the apiserver on it. My scrape config is below and largely based on the example Grafana give in their documentation, so not 100% sure what I am doing here. If I go then go to Prometheus and run a query such as cadvisor_version_info it will only display my worker-only nodes (as indentified by the instance) but not the leader node that contains the apiserver. How can I adjust this so that it scrapes the metrics from the leader node with the apiserver as well?

- job_name: kubernetes-nodes-cadvisor
  scrape_interval: 1m
  scrape_timeout: 15s
  scheme: https  # remove if you want to scrape metrics on insecure port
  tls_config:
    ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    insecure_skip_verify: true
  bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
  kubernetes_sd_configs:
    - role: node
  relabel_configs:
    - action: labelmap
      regex: __meta_kubernetes_node_label_(.+)
    - target_label: __address__
      replacement: kubernetes.default.svc:443
    - source_labels: [__meta_kubernetes_node_name]
      regex: (.+)
      target_label: __metrics_path__
      replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor
  metric_relabel_configs:
    - action: replace
      source_labels: [id]
      regex: '^/machine\.slice/machine-rkt\\x2d([^\\]+)\\.+/([^/]+)\.service$'
      target_label: rkt_container_name
      replacement: '${2}-${1}'
    - action: replace
      source_labels: [id]
      regex: '^/system\.slice/(.+)\.service$'
      target_label: systemd_service_name
      replacement: '${1}'
waltinator avatar
it flag
Please read https://askubuntu.com/help/how-to-ask and https://askubuntu.com/help/formatting . Take the [tour].
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.