google/cloudprober

Allow multiple substitution tokens in additional labels

xenofree opened this issue · 3 comments

Hi,

Is there a way to create a label that contains full url of an http probe ?
Something like @target.name@:@target.port@@target.relative_url@

probe {
  name: "http"

  type: HTTP
  targets {
    host_names: "172.18.0.142"
  }
  http_probe {
    port: 8080
    relative_url: "/test"
  }
  interval_msec: 15000 # 15s
  timeout_msec: 5000   # 5s

  additional_label {
    key: "url"
    value: "@target.name@:@target.port@@target.relative_url@" #Should be replaced by 172.18.0.142:8080/test
  }
}

Yeah, It's not possible to compose labels today. I'll see we can somehow implement it.

I am working on a change to add this feature. I'll submit it in a couple of days.

This is now done. Please track the milestone v0.11.3 for release. In the meantime, you can use the docker tag "master" to access the latest changes (or download the latest binaries from the project's Actions page).