Skip to content

Support Spinnaker's various TimeUnit's #37

@karlskewes

Description

@karlskewes

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:

  1. 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.
  2. Find some way to parse the time unit?
  3. Do nothing?
  4. Other?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions