Earliest() on string field


#1

What is the correct way to write a metric that returns the earliest string data point ?

For example, the measurement type has a string field:

type HotTagMeasurement mixes TimedDataPoint {
stringValue: string
}

The following metric will return completely missing timeseries even when measurements are present:
{
“id”: “EarliestHotTagStringMeasurements_PiTag”,
“name”: “EarliestHotTagStringMeasurements”,
“srcType”: “PiTag”,
“path”: “hotMeasurements”,
“expression”: “earliest(normalized.data.stringValue)”
}


#2

you need to add @ts to your string field so that it’s picked by the normalizer. Check this thread