github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/examples/golang-pull/consul/config/pyroscope-server.yml (about)

     1  ---
     2  log-level: debug
     3  scrape-configs:
     4    - job-name: consul-services
     5      enabled-profiles: [cpu, mem, goroutines, mutex, block]
     6      consul-sd-configs:
     7        - server: 'consul:8500'
     8          # Optionally specify the datacenter.
     9          datacenter: "dc1"
    10          # You may explicitly list services you want to profile.
    11          # By default, all discovered services are scraped.
    12          services:
    13           - test-service
    14  
    15      relabel-configs:
    16        # Optionally filter out unhealthy instances.
    17        - source-labels: [ __meta_consul_health ]
    18          action: keep
    19          regex: passing
    20  
    21        # Pyroscope server needs application name (the '__name__' label)
    22        # to be provided for every profile in order to properly aggregate data.
    23        - source-labels: [__meta_consul_service]
    24          action: replace
    25          target-label: __name__
    26  
    27        # Pyroscope server is not aware of the application language and runtime,
    28        # if profiling data is pulled from the target. You can optionally specify
    29        # '__spy_name__' label to indicate it: here we take the value from the
    30        # 'pyroscope_spy_name' metadata item. By default, Go (gospy) is assumed.
    31        - source-labels:
    32            [ __meta_consul_service_metadata_pyroscope_spy_name ]
    33          action: replace
    34          target-label: __spy_name__
    35        - regex: __meta_consul_service_metadata_pyroscope_spy_name
    36          action: labeldrop
    37  
    38        # Labels that are specific to the consul service discovery (__meta_consul_*)
    39        # can be used as pyroscope labels.
    40        - source-labels: [__meta_consul_dc]
    41          action: replace
    42          target-label: consul_dc
    43  
    44        # Service metadata can be also mapped to pyroscope labels directly.
    45        - action: labelmap
    46          regex: __meta_consul_service_metadata_(.+)