github.com/google/cloudprober@v0.11.3/examples/additional_label/cloudprober.cfg (about)

     1  # You can add additional labels to the probe results using the probe-level field,
     2  # "additional_label".  An additional label's value can be static or it can be
     3  # derived from the target labels.
     4  #
     5  # For the following config:
     6  #   if ingress target has label "fqdn:app.example.com",
     7  #   and prober is running in the GCE zone "us-east1-c",
     8  #   and prober's GCE instance has label "env:prod".
     9  # 
    10  # Probe results will look like the following:
    11  #   total{probe="my_ingress",ptype="http",metrictype="prober",env="prod",src_zone="us-east1-c",host="app.example.com"}: 90
    12  # success{probe="my_ingress",ptype="http",metrictype="prober",env="prod",src_zone="us-east1-c",host="app.example.com"}: 80
    13  probe {
    14    name: "my_ingress"
    15    type: HTTP
    16  
    17    targets {
    18      rds_targets {
    19        resource_path: "k8s://ingresses"
    20        filter {
    21          key: "namespace"
    22          value: "default"
    23        }
    24      }
    25    }
    26    
    27    # Static label
    28    additional_label {
    29      key: "metrictype"
    30      value: "prober"
    31    }
    32    
    33    # Label is configured at the run time, based on the prober instance label (GCE).
    34    additional_label {
    35      key: "env"
    36      value: "{{.label_env}}"
    37    }
    38    
    39    # Label is configured at the run time, based on the prober environment (GCE).
    40    additional_label {
    41      key: "src_zone"
    42      value: "{{.zone}}"
    43    }
    44    
    45    # Label is configured based on the target labels.
    46    additional_label {
    47      key: "host"
    48      value: "@target.label.fqdn@"
    49    }
    50  
    51    http_probe {}
    52  }