fix: fix job metrics naming

For duration historgrams, the exporter takes care of the correct suffix
depending on the resolution used by it. For example the prometheus
exporter will use a `..._seconds` metric to encode the historgram. The
IOx internal metric should therefore NOT append any resolution. This
then removes the `_nanoseconds` suffix, renaming the externally visible
metric from

```text
influxdb_iox_job_completed_{cpu,wall}_nanoseconds_seconds
```

to

```text
influxdb_iox_job_completed_{cpu,wall}_seconds
```
pull/24376/head
Marco Neumann 2021-09-08 14:16:47 +02:00
parent c415d357cc
commit 0a31f5f2e5
2 changed files with 8 additions and 12 deletions

View File

@ -107,12 +107,12 @@ impl JobRegistryMetrics {
.register_metric("influxdb_iox_job_count", "Number of known jobs"),
completed_accu: Default::default(),
cpu_time_histogram: metric_registry_v2.register_metric(
"influxdb_iox_job_completed_cpu_nanoseconds",
"CPU time of of completed jobs in nanoseconds",
"influxdb_iox_job_completed_cpu",
"CPU time of of completed jobs",
),
wall_time_histogram: metric_registry_v2.register_metric(
"influxdb_iox_job_completed_wall_nanoseconds",
"Wall time of of completed jobs in nanoseconds",
"influxdb_iox_job_completed_wall",
"Wall time of of completed jobs",
),
completed_but_still_tracked: Default::default(),
}

View File

@ -2484,13 +2484,11 @@ mod tests {
);
assert_eq!(observation, &metric::Observation::U64Gauge(1));
// ========== influxdb_iox_job_completed_cpu_nanoseconds ==========
// ========== influxdb_iox_job_completed_cpu ==========
let observations: Vec<_> = reporter
.observations()
.iter()
.filter(|observation| {
observation.metric_name == "influxdb_iox_job_completed_cpu_nanoseconds"
})
.filter(|observation| observation.metric_name == "influxdb_iox_job_completed_cpu")
.collect();
assert_eq!(observations.len(), 1);
@ -2507,13 +2505,11 @@ mod tests {
])
);
// ========== influxdb_iox_job_completed_wall_nanoseconds ==========
// ========== influxdb_iox_job_completed_wall ==========
let observations: Vec<_> = reporter
.observations()
.iter()
.filter(|observation| {
observation.metric_name == "influxdb_iox_job_completed_wall_nanoseconds"
})
.filter(|observation| observation.metric_name == "influxdb_iox_job_completed_wall")
.collect();
assert_eq!(observations.len(), 1);