NumberDataPoint: {
    attributes: KeyValue[];
    exemplars: Exemplar[] | EmptyJsonArray;
    flags: number;
    startTimeUnixNano: Nanos;
    timeUnixNano: Nanos;
} & ({ asInt: number } | { asDouble: number })

🔢 NumberDataPoint is a single data point in a timeseries for scalar values.

Used by gauges and sums to represent individual measurements with timestamps and attributes. Can contain either integer or floating-point values.

Type declaration

  • attributes: KeyValue[]

    Attributes for this specific data point

  • exemplars: Exemplar[] | EmptyJsonArray

    Example values that led to this data point

  • flags: number

    Additional flags for this data point

  • startTimeUnixNano: Nanos

    Start time for this measurement period (nanoseconds since Unix epoch)

  • timeUnixNano: Nanos

    Timestamp of this measurement (nanoseconds since Unix epoch)

  • { asInt: number }
    • asInt: number

      Integer value

  • { asDouble: number }
    • asDouble: number

      Floating-point value

const fuelLevelDataPoint: NumberDataPoint = {
attributes: [
{ key: "turtle.id", value: { intValue: 42 } },
{ key: "fuel.type", value: { stringValue: "coal" } }
],
startTimeUnixNano: "1640995200000000000",
timeUnixNano: "1640995260000000000",
asInt: 15000,
exemplars: [],
flags: 0
};