Spinnaker code doesn't just use TimeUnit.SECONDS throughout the code, various incantations such as TimeUnit.MILLISECONDS and TimeUnit.NANOSECONDS are also used.
Example: https://github.com/spinnaker/kork/blob/master/kork-sql/src/main/kotlin/com/netflix/spinnaker/kork/sql/telemetry/HikariSpectatorMetricsTracker.kt#L52
registry.timer(connectionAcquiredId).record(elapsedAcquiredNanos, TimeUnit.NANOSECONDS)
In the plugin, we only use seconds and thus our metric values can be off.
|
protected TimeUnit getBaseTimeUnit() { |
|
return TimeUnit.SECONDS; |
|
} |
I don't know if we can reliably determine the unit of time and include in our metric name per Prometheus Best Practices.
Potential options:
- Drop time unit from name (eg:
_seconds) and require users of the plugin to discover the unit through Spinnaker source code? I am happy to work through the spinnaker-mixin dashboards and alerts.
- Find some way to parse the time unit?
- Do nothing?
- Other?
Spinnaker code doesn't just use
TimeUnit.SECONDSthroughout the code, various incantations such asTimeUnit.MILLISECONDSandTimeUnit.NANOSECONDSare also used.Example: https://github.com/spinnaker/kork/blob/master/kork-sql/src/main/kotlin/com/netflix/spinnaker/kork/sql/telemetry/HikariSpectatorMetricsTracker.kt#L52
In the plugin, we only use
secondsand thus our metric values can be off.armory-observability-plugin/common/src/main/java/io/micrometer/prometheus/MutatedPrometheusMeterRegistry.java
Lines 432 to 434 in 9bcb277
I don't know if we can reliably determine the unit of time and include in our metric name per Prometheus Best Practices.
Potential options:
_seconds) and require users of the plugin to discover the unit through Spinnaker source code? I am happy to work through the spinnaker-mixin dashboards and alerts.