Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ Downsampling is applied to the individual backing indices of the TSDS. The downs
3. For each [time series metric](time-series-data-stream-tsds.md#time-series-metric) field, computes aggregations for all documents in the bucket.

* `gauge` field type:
* `min`, `max`, `sum`, and `value_count` are stored as type `aggregate_metric_double`
* `min`, `max`, `sum`, and `value_count` are stored as type `aggregate_metric_double`.
* `counter` field type:
* `last_value` is stored.
* the last value is stored and the type is preserved.
* `histogram` field type: {applies_to}`stack: preview 9.3` {applies_to}`serverless: preview`
* individual histograms are merged into a single histogram that is stored, preserving the type. The `histogram` field type uses the [T-Digest](elasticsearch://reference/aggregations/search-aggregations-metrics-percentile-aggregation.md) algorithm.

4. For all other fields, copies the most recent value to the target index.
5. Replaces the original index with the downsampled index, then deletes the original index.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,16 @@ You can also simplify dimension definitions by using [pass-through](elasticsearc

Metrics are numeric measurements that change over time. Documents in a TSDS typically contain one or more metric fields.

To mark a field as a metric, use the `time_series_metric` mapping parameter. This parameter ensures data is stored in an optimal way for time series analysis. The following field types support the `time_series_metric` parameter:

* All [numeric field types](elasticsearch://reference/elasticsearch/mapping-reference/number.md)
* [`aggregate_metric_double`](elasticsearch://reference/elasticsearch/mapping-reference/aggregate-metric-double.md), for internal use during downsampling (rarely user-populated)

The valid values for `time_series_metric` are `counter` and `gauge`:
To mark a field as a metric, use the `time_series_metric` mapping parameter. This parameter ensures data is stored in an optimal way for time series analysis. The valid values for `time_series_metric` are `counter`, `gauge` and `histogram`:

`counter`
: A cumulative metric that only monotonically increases or resets to `0` (zero). For example, a count of errors or completed tasks that resets when a serving process restarts.
: A cumulative metric that only monotonically increases or resets to `0` (zero). For example, a count of errors or completed tasks that resets when a serving process restarts. A counter is supported by all [numeric field types](elasticsearch://reference/elasticsearch/mapping-reference/number.md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this int, long and double?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mapping accepts all numeric fields, I have tried scaled_float, float, byte, short. I haven't tested it end to end though, I mean index data, downsample, run ESQL queries. Do you think this is something we need to explore further?


`gauge`
: A metric that represents a single numeric that can arbitrarily increase or decrease. For example, a temperature or available disk space.
: A metric that represents a single numeric that can arbitrarily increase or decrease. For example, a temperature or available disk space. A gauge is supported by all [numeric field types](elasticsearch://reference/elasticsearch/mapping-reference/number.md) and [`aggregate_metric_double`](elasticsearch://reference/elasticsearch/mapping-reference/aggregate-metric-double.md) (for internal use during downsampling, rarely user-populated).

`histogram` {applies_to}`stack: preview 9.3` {applies_to}`serverless: preview`
: A metric that tracks the distribution of numerical values, like latency or size distributions. A histogram is supported by [`histogram`](elasticsearch://reference/elasticsearch/mapping-reference/histogram.md) and [`exponential_histogram`](elasticsearch://reference/elasticsearch/mapping-reference/exponential-histogram.md).

#### `_tsid` metadata field [tsid]

Expand Down
Loading