What is default treatment for simple metric on non-normalized data without tsDecl (TimedValue and TimedInterval)?

#1

I’m defining a simple metric against a type where the objects pointed to by ‘path’ are TimedValue objects. When I define the metric without using tsDecl (i.e., without specifying ‘treatment’, ‘start’, ‘end’ etc…) it seems the default treatment is to use ‘timestamp’ as ‘start’ and ‘previous’ as the 'treatment. However, I don’t see this default behavior documented.

  1. Can you confirm this is the default behavior?
  2. Are there other reasons to use tsDecl if the default behaviors without tsDecl suit my needs?
  3. What are the default behaviors if the objects at the end of ‘path’ are of type TimedInterval?
0 Likes

#2
  1. Yes, this is the default behavior for a TimedValueHistory series. This type is specifically used for keeping a history of values were over time. TimedValues are designed to track changes in values for something that doesn’t get new data in a regular interval, so naturally the default behavior should be to use whatever value of the most recent data point. timestamp is the default time field as well
  2. There are plenty of reasons to use a TsDecl besides overriding the defaults you listed. A couple examples include: filtering some data out of the metric, transforming the output of the timeseries, or applying a different kind of overlap handling when you have multiple data points that occur on the same date. It all depends on your use case, but if you don’t need any of these for the specific metric you’re defining that’s fine
  3. If you have TimedInterval values, you then have a start and end field on those values. Those two fields are used for the start and end times for each data point in a timeseries

I can’t find a place where it’s explicitly stated that ‘previous’ is the default treatment for TimedValues, but it makes sense in the context of what the type was designed to do. If you want you can find a little bit more explaining all the Timed* types at:

<vanity-url>/api/1/<tenant>/<tag>/documentation/topic/timed-values

1 Like