github.com/grafana/pyroscope@v1.18.0/examples/grafana-alloy-auto-instrumentation/ebpf/docker/config.alloy (about)

     1  
     2  discovery.docker "all" {
     3  	host = "unix:///var/run/docker.sock"
     4  }
     5  
     6  discovery.relabel "pyroscope" {
     7      targets = discovery.docker.all.targets
     8      // Filter needed containers based on docker labels
     9      // See more info at reference doc https://grafana.com/docs/alloy/next/reference/components/discovery/discovery.docker/
    10      rule {
    11          source_labels = ["__meta_docker_container_name"]
    12          regex = ".*pyroscope.*"
    13          action = "keep"
    14      }
    15      // provide arbitrary service_name label, otherwise it will default to value of __meta_docker_container_name
    16      rule {
    17          source_labels = ["__meta_docker_container_name"]
    18          regex = ".*pyroscope.*"
    19          action = "replace"
    20          target_label = "service_name"
    21          replacement = "ebpf/docker/pyroscope"
    22      }
    23  }
    24  
    25  
    26  pyroscope.ebpf "instance" {
    27    forward_to = [pyroscope.write.endpoint.receiver]
    28    targets = discovery.relabel.pyroscope.output
    29  }
    30  
    31  pyroscope.write "endpoint" {
    32    endpoint {
    33      url = "http://pyroscope:4040"
    34      // url = "<Grafana Cloud URL>"
    35      // basic_auth {
    36      //  username = "<Grafana Cloud User>"
    37      //  password = "<Grafana Cloud Password>"
    38      // }
    39    }
    40  }