--- # Create Cluster Role and bind it to Pyroscope to enable it watching Kubernetes resources. rbac: create: true # Pyroscope configuration. pyroscopeConfigs: log-level: debug scrape-configs: # Example scrape config for pods # # The relabeling allows the actual pod scrape endpoint to be configured via the # following annotations: # # * `pyroscope.io/scrape`: Only scrape pods that have a value of `true`. # * `pyroscope.io/application-name`: Name of the application being profiled. # * `pyroscope.io/scheme`: If the metrics endpoint is secured then you will need # to set this to `https` & most likely set the `tls_config` of the scrape config. # * `pyroscope.io/port`: Scrape the pod on the indicated port. # * `pyroscope.io/profile-{profile_name}-path`: Specifies URL path exposing pprof profile. # * `pyroscope.io/profile-{profile_name}-param-{param_key}`: Overrides scrape URL parameters. # # Kubernetes labels will be added as Pyroscope labels on metrics via the # `labelmap` relabeling action. - job-name: 'kubernetes-pods' enabled-profiles: [cpu, mem] kubernetes-sd-configs: - role: pod relabel-configs: - source-labels: [__meta_kubernetes_pod_annotation_pyroscope_io_scrape] action: keep regex: true - source-labels: [__meta_kubernetes_pod_annotation_pyroscope_io_application_name] action: replace target-label: __name__ - source-labels: [__meta_kubernetes_pod_annotation_pyroscope_io_spy_name] action: replace target-label: __spy_name__ - source-labels: [__meta_kubernetes_pod_annotation_pyroscope_io_scheme] action: replace regex: (https?) target-label: __scheme__ - source-labels: [__address__, __meta_kubernetes_pod_annotation_pyroscope_io_port] action: replace regex: ([^:]+)(?::\d+)?;(\d+) replacement: $1:$2 target-label: __address__ - action: labelmap regex: __meta_kubernetes_pod_label_(.+) - source-labels: [__meta_kubernetes_namespace] action: replace target-label: kubernetes_namespace - source-labels: [__meta_kubernetes_pod_name] action: replace target-label: kubernetes_pod_name - source-labels: [__meta_kubernetes_pod_phase] regex: Pending|Succeeded|Failed|Completed action: drop - action: labelmap regex: __meta_kubernetes_pod_annotation_pyroscope_io_profile_(.+) replacement: __profile_$1 - job-name: 'kubernetes-svcs' enabled-profiles: [cpu, mem] kubernetes-sd-configs: - role: service relabel-configs: - source-labels: [__meta_kubernetes_service_annotation_pyroscope_io_scrape] action: keep regex: true - source-labels: [__meta_kubernetes_service_annotation_pyroscope_io_application_name] action: replace target-label: __name__ - source-labels: [__meta_kubernetes_service_annotation_pyroscope_io_spy_name] action: replace target-label: __spy_name__ - source-labels: [__meta_kubernetes_service_annotation_pyroscope_io_scheme] action: replace regex: (https?) target-label: __scheme__ - source-labels: [__address__, __meta_kubernetes_service_annotation_pyroscope_io_port] action: replace regex: ([^:]+)(?::\d+)?;(\d+) replacement: $1:$2 target-label: __address__ - action: labelmap regex: __meta_kubernetes_service_label_(.+) - source-labels: [__meta_kubernetes_namespace] action: replace target-label: kubernetes_namespace - source-labels: [__meta_kubernetes_service_name] action: replace target-label: kubernetes_service_name - source-labels: [__meta_kubernetes_service_phase] regex: Pending|Succeeded|Failed|Completed action: drop - action: labelmap regex: __meta_kubernetes_service_annotation_pyroscope_io_profile_(.+) replacement: __profile_$1