# Metric types

Each ingested and aggregated metric has a metric type, a critical piece of metadata that indicates what kind of data a metric represents. Metric types affect how the data aggregates for storage, long-term downsampling behaves, and how that data displays within the Chronosphere app.

If a metric is ingested or aggregated with the wrong type, you can get unexpected results when aggregating or querying the data, or data loss when persisting data in long term storage.

## Chronosphere types

The Chronosphere metric platform supports ingesting many different metric types.

### Cumulative counter

A counter which stores a strictly increasing count of distinct events or a reset-to-zero on restart. Counters are a fundamental metric construct that keeps track of the number of times a certain event has occurred.

- Each datapoint stores the running total at the given timestamp.
- Aggregated using
`metric_type=CUMULATIVE_COUNTER`

rollup rules - Queryable as a Prometheus counter (opens in a new tab).
- Subject to long-term downsampling.
- View incoming cumulative counters with a
`__metric_type__:cumulative_counter`

filter in the Live Telemetry Analyzer.

Examples of cumulative counters include:

- Number of requests served.
- Number of user logins.
- Number of heap allocations.

### Delta counter

A counter where each data point stores a strictly positive delta increment at the given timestamp. With this method, the client only keeps track of how many events since the last emission or flush of the metric value and only emit that value. It doesn't keep a running sum.

- Stores the same kinds of data as cumulative counters, but with a different format.
- Delta counters must use a
`metric_type=DELTA_COUNTER`

rollup rule with`drop_raw=true`

to aggregate delta counters into a cumulative counter. Raw delta counter data can't be persisted. - View incoming delta counters with a
`__metric_type__:delta_counter`

filter in the Live Telemetry Analyzer.

An example of a delta counter is:

- A client sends a 1 every time a request is served to count the number of requests served.

### Gauge

A gauge is a basic metric type that tracks a value which changes over time.

- Each datapoint stores the value at the given timestamp. It is impossible to have two values at the same point in time.
- Aggregated with
`metric_type=GAUGE`

rollup rules. - Queryable as a Prometheus gauge (opens in a new tab).
- Subject to long-term downsampling.
- View incoming gauges with a
`__metric_type__:gauge`

filter in the Live Telemetry Analyzer.

Some examples of gauges are:

- Current number of in-flight requests.
- Current number of signed-in users.
- Current amount of memory in use.

### Measurement

A raw observation with some discrete value. Measurements differ from counters as each measurement event has a discrete, arbitrary value. Measurements also differ from a gauge, as there can be multiple values at any point in time.

- You must use a
`metric_type=MEASUREMENT`

rollup rule with`drop_raw=true`

to aggregate measurements into a persistable metric type. Raw measurement data can't be persisted. - The
`MEASUREMENT`

metric type is best used when all values should be aggregated at once across many matching time series. - View incoming measurements with a
`__metric_type__:measurement`

filter in the Live Telemetry Analyzer.

Some examples of measurements are:

- The latency of an individual request
- The payload size of an individual request

## Supported formats

Chronosphere can ingest metrics from many different external metric clients. Each external metric client has their own concept of "metric type" which is mapped into a Chronosphere metric type.

### Prometheus

Prometheus Type | Chronosphere Type |
---|---|

Gauge | Gauge |

Counter | Cumulative counter |

Histogram | Cumulative counter |

Summary (quantile data points) | Gauge |

Summary (sum/count data points) | Cumulative counter |

### OpenTelemetry

OpenTelemetry Type | Chronosphere Type |
---|---|

Gauge | Gauge |

Cumulative monotonic sum | Cumulative counter |

Delta monotonic sum | Delta counter |

Cumulative histogram | Cumulative counter |

Delta histogram | Delta counter |

Summary (quantile data points) | Gauge |

Summary (sum/count data points) | Cumulative counter |

Cumulative non-monotonic sum | Gauge |

Chronosphere does not support delta non-monotonic sums (also known as delta up-down counters).

### Datadog

Datadog Type | Chronosphere Type |
---|---|

Gauge | Gauge |

Count | Delta counter |

Histogram | Measurement |

Distribution | Measurement |

### SignalFX

SignalFX Type | Chronosphere Type |
---|---|

Gauge | Gauge |

Cumulative | Cumulative counter |

Counter | Delta counter |

### Wavefront

Wavefront Type | Chronosphere Type |
---|---|

Gauge | Gauge |

Counter | Cumulative counter |

Delta counter | Delta counter |

Histogram | Cumulative counter |

### StatsD

StatsD Type | Chronosphere Type |
---|---|

Gauge | Gauge |

Counter | Delta counter |

Timer | Measurement |

### GCP Metrics

GCP Type | Chronosphere Type |
---|---|

Gauge | Gauge |

Cumulative | Cumulative counter |

Delta | Delta counter |