Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubernetes Pods not visible under targets section #4883

Closed
sojinss4u opened this issue Jul 23, 2024 · 0 comments · Fixed by #4937
Closed

Kubernetes Pods not visible under targets section #4883

sojinss4u opened this issue Jul 23, 2024 · 0 comments · Fixed by #4937

Comments

@sojinss4u
Copy link

sojinss4u commented Jul 23, 2024

Hello,

To obtain memory profiles from my Go application, I enabled the K8s SD scrape configuration in the parca.yaml file using the configuration below. Despite enabling the scrape configs, no pods were listed under the 'kubernetes-pods' section. However, I was still able to see some memory profiles in the UI, even though no targets appeared there.

- job_name: kubernetes-pods
    scrape_interval: "60s"
    profiling_config:
        pprof_config:
          process_cpu:
            enabled: false
        process_cpu:
          enabled: false
    kubernetes_sd_configs:
      - role: pod
    relabel_configs:
      - action: labelmap
        regex: __meta_kubernetes_pod_label_app_kubernetes_io_(.+)
        replacement: "app_kubernetes_io_$1"
      - source_labels: [__meta_kubernetes_namespace]
        action: replace
        target_label: namespace
      - source_labels: [__meta_kubernetes_pod_name]
        action: replace
        target_label: pod
      - source_labels: [__meta_kubernetes_pod_container_name]
        action: replace
        target_label: container

However I started seeing targets listed under the 'kubernetes-pods' section in UI after modifying the scrape configuration to only target pods with a label 'parca.io/scrape: "true"'. There is only one application in this cluster with this label. I suspect that the UI is not listing the targets when the number of targets it need to scrape (pod + url combination) is too large.

 - job_name: kubernetes-pods
      scrape_interval: "60s"
      profiling_config:
        pprof_config:
          process_cpu:
            enabled: false
      kubernetes_sd_configs:
        - role: pod
      relabel_configs:
        - source_labels: [__meta_kubernetes_pod_annotation_parca_io_scrape__]
          regex: true
          action: keep
        - action: labelmap
          regex: __meta_kubernetes_pod_label_app_kubernetes_io_(.+)
          replacement: "app_kubernetes_io_$1"
        - source_labels: [__meta_kubernetes_namespace]
          action: replace
          target_label: namespace
        - source_labels: [__meta_kubernetes_pod_name]
          action: replace
          target_label: pod
        - source_labels: [__meta_kubernetes_pod_container_name]
          action: replace
          target_label: container

For more details, please refer to this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant