Skip to content

Files

Latest commit

 

History

History

metricstarttimeprocessor

Status
Stability development: metrics
Distributions []
Issues Open issues Closed issues
Code Owners @dashpole, @ridwanmsharif

Description

The metric start time processor (metricstarttime) is used to set the start time for metric points with a cumulative aggregation temporality. It is commonly used with the prometheus receiver, which usually produces metric points without a start time.

Configuration

Configuration allows configuring the strategy used to set the start time.

processors:
    # processor name: metricstarttime
    metricstarttime:

        # specify the strategy to use for setting the start time
        strategy: true_reset_point

Strategy: True Reset Point

The true_reset_point strategy handles missing start times for cumulative points by producing a stream of points that starts with a True Reset Point. The true reset point has its start time set to its end timestamp. It is meant to indicate the absolute value of the cumulative point when the collector first observed it. Subsequent points re-use the start timestamp of the initial True Reset point.

Pros:

  • The absolute value of the cumulative metric is preserved.
  • It is possible to calculate the correct rate between any two points since the timestamps and values are not modified.

Cons:

  • This strategy is stateful because the initial True Reset point is necessary to properly calculate rates on subsequent points.
  • The True Reset point doesn't make sense semantically. It has a zero duration, but non-zero values.
  • Many backends reject points with equal start and end timestamps.
    • If the True Reset point is rejected, the next point will appear to have a very large rate.

Strategy: Subtract Initial Point

The subtract_initial_point strategy handles missing start times for cumulative points by dropping the first point in a cumulative series, "subtracting" that point's value from subsequent points and using the initial point's timestamp as the start timestamp for subsequent points.

Pros:

  • Cumulative semantics are preserved. This means that for a point with a given [start, end] interval, the cumulative value occurred in that interval.
  • Rates over resulting timeseries are correct, even if points are lost. This strategy is not stateful.

Cons:

  • The absolute value of counters is modified. This is generally not an issue, since counters are usually used to compute rates.
  • The initial point is dropped, which loses information.