Skip to content
This repository was archived by the owner on Nov 5, 2021. It is now read-only.
This repository was archived by the owner on Nov 5, 2021. It is now read-only.

additional_label's are missing in custom metrics of EXTERNAL probe #654

Description

@skuethe

First off, thank you for providing this very useful tool! :)

Describe the bug
It seems that any additional_label defined inside an EXTERNAL probe only applies to the build-in metrics (success, total and latency). Any custom metrics returned by the external probe does not have these labels set.

Cloudprober Version
Tested both v0.11.2 and latest master (as of today: 2021-08-25)

To Reproduce
I have an external probe which calls Azure API and returns additional data about the remaining API rate limits (which are send by Azure in the HTTP Header). For example Microsoft_Compute_LowCostGet30Min.
These custom metrics are exposed and scraped successfully, but the labels are missing. My probe configuration looks like this:

probe {
  name: "azure_vms"
  type: EXTERNAL

  [...]

  external_probe {
    mode: ONCE
    command: "azureapiprobe --vmname @target@ --rgname @target.label.rgname@"
  }
  additional_label {
    key: "rgname"
    value: "@target.label.rgname@"
  }
  additional_label {
    key: "os"
    value: "@target.label.os@"
  }
}

Example output:

## These are fine:

#TYPE cloudprober_success counter
cloudprober_success{ptype="external",probe="azure_vms",dst="TARGETNAME",rgname=RGNAME,os="linux"} 2 1629904383080
#TYPE cloudprober_total counter
cloudprober_total{ptype="external",probe="azure_vms",dst="TARGETNAME",rgname=RGNAME,os="linux"} 2 1629904383080
#TYPE cloudprober_latency counter
cloudprober_latency{ptype="external",probe="azure_vms",dst="TARGETNAME",rgname=RGNAME,os="linux"} 896401.042 1629904383080

## This is missing the `rgname` and `os` labels:

#TYPE cloudprober_ratelimit_Microsoft_Compute_LowCostGet30Min gauge
cloudprober_ratelimit_Microsoft_Compute_LowCostGet30Min{ptype="external",probe="azure_vms",dst="TARGETNAME"} 31779.000 1629904383080

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions