Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
3 changes: 2 additions & 1 deletion manage-data/data-store/data-streams/quickstart-tsds.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,10 @@ This quickstart introduced the basics of time series data streams. To learn more

* [](/manage-data/data-store/data-streams/time-series-data-stream-tsds.md)
* [](/manage-data/data-store/data-streams/set-up-tsds.md)
* [](/manage-data/data-store/data-streams/tsds-ingest-otlp.md)

For more information about the APIs used in this quickstart, review the {{es}} API reference documentation:

* [Bulk API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)
* [Index template API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template)
* [Search API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search)
* [Search API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search)
7 changes: 5 additions & 2 deletions manage-data/data-store/data-streams/set-up-tsds.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ products:

# Set up a time series data stream [set-up-tsds]

This page shows you how to set up a [time series data stream](/manage-data/data-store/data-streams/time-series-data-stream-tsds.md) (TSDS).
This page shows you how to manually set up a [time series data stream](/manage-data/data-store/data-streams/time-series-data-stream-tsds.md) (TSDS).

For a simplified setup that doesn't require manually mapping dimension and metric fields via index templates,
have a look at the [OpenTelemetry Protocol (OTLP)-based data ingestion](tsds-ingest-otlp.md).

## Before you begin [tsds-prereqs]

Expand Down Expand Up @@ -188,4 +191,4 @@ Now that you've set up a time series data stream, you can manage and use it like
* [Use a data stream](use-data-stream.md) for indexing and searching
* [Change data stream settings](modify-data-stream.md#data-streams-change-mappings-and-settings) as needed
* Query time series data using the {{esql}} [`TS` command](elasticsearch://reference/query-languages/esql/commands/ts.md)
* Use [data stream APIs](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-data-stream)
* Use [data stream APIs](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-data-stream)
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ You can use the {{esql}} [`TS` command](elasticsearch://reference/query-language

* Try the [quickstart](/manage-data/data-store/data-streams/quickstart-tsds.md) for a hands-on introduction
* [Set up a time series data stream](/manage-data/data-store/data-streams/set-up-tsds.md)
* [Ingest data using the OpenTelemetry Protocol (OTLP)](/manage-data/data-store/data-streams/tsds-ingest-otlp.md)
* Learn about [downsampling](/manage-data/data-store/data-streams/downsampling-time-series-data-stream.md) to reduce storage footprint

% suppress anchor warnings until chicken-and-egg resolved
Expand All @@ -125,4 +126,4 @@ You can use the {{esql}} [`TS` command](elasticsearch://reference/query-language
##### [tsds-look-back-time]
##### [time-bound-indices]
##### [dimension-based-routing]
##### [tsds-accepted-time-range]
##### [tsds-accepted-time-range]
84 changes: 84 additions & 0 deletions manage-data/data-store/data-streams/tsds-ingest-otlp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
navigation_title: "Ingest OTLP metrics"
applies_to:
stack: preview 9.2
products:
- id: elasticsearch
---

# Ingest metrics using the OpenTelemetry Protocol (OTLP)

In addition to the ingestion of metrics data through the bulk API,
{{es}} offers an alternative way to ingest data via the [OpenTelemetry Protocol (OTLP)](https://opentelemetry.io/docs/specs/otlp).

The endpoint is available under `/_otlp/v1/metrics`.

Ingesting metrics data using the OTLP endpoint has the following advantages:

* Improved ingestion performance, especially if the data contains many resource attributes.
* Simplified index mapping:
there's no need to manually create an index template, or define dimensions and metrics.
Using the OTLP endpoint, metrics are dynamically mapped using the metadata included in the OTLP requests.

:::{important}
On {{ecloud}} , use the [{{motlp}}](opentelemetry:/reference/motlp.md) instead of connecting directly to the {{es}} OTLP endpoint.
:::

## How to send data to the OTLP endpoint

To send data from an OpenTelemetry Collector to the {{es}} OTLP endpoint,
use the [`OTLP/HTTP` exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlphttpexporter).
This is an example configuration:

```yaml
extensions:
basicauth/elasticsearch:
client_auth:
username: <user>
password: <password>
exporters:
otlphttp/elasticsearch:
endpoint: <es_endpoint>/_otlp
sending_queue:
enabled: true
sizer: requests
queue_size: 5000
block_on_overflow: true
batch:
flush_timeout: 5s
sizer: bytes
min_size: 2_000_000
max_size: 5_000_000
auth:
authenticator: basicauth/elasticsearch
```
:::{note}
Only `encoding: proto` is supported, which the `OTLP/HTTP` exporter uses by default.
:::
The supported options for `compression` are `gzip` (default value of the `OTLP/HTTP` exporter) and `none`.

% TODO we might actually also support snappy and zstd, test and update accordingly)

To track metrics in your custom application,
use the [OpenTelemetry language SDK](https://opentelemetry.io/docs/getting-started/dev/) of your choice.

## When not to use the {{es}} OTLP endpoint

Do not send metrics from applications directly to the {{es}} OTLP endpoint, especially if there are many individual applications that periodically send a small amount of metrics. Instead, send data to an OpenTelemetry Collector first. This helps with handling many connections, and with creating bigger batches to improve ingestion performance. For more details on the recommended way to set up OpenTelemetry-based data ingestion, refer to the [EDOT reference architecture](opentelemetry:/reference/architecture/index.md).

At this point, {{es}} only supports the OTLP metrics endpoint (`/_otlp/v1/metrics`). Other signals are not supported through a native {{es}} OTLP endpoint at the moment. To ingest logs, traces, and profiles, use a distribution of the OpenTelemetry Collector that includes the [{{es}} exporter](opentelemetry:/reference/edot-collector/components/elasticsearchexporter.md), like the [Elastic Distribution of OpenTelemetry (EDOT) Collector](opentelemetry:/reference/edot-collector/index.md).

## Send data to different data streams

By default, metrics are ingested into the `metrics-generic.otel-default` data stream. You can influence the target data stream by setting specific attributes on your data:

- `data_stream.dataset` or `data_stream.namespace` in attributes, with the following order of precedence: data point attribute -> scope attribute -> resource attribute
- Otherwise, if the scope name contains `/receiver/<somereceiver>`, `data_stream.dataset` is set to the receiver name.
- Otherwise, `data_stream.dataset` falls back to `generic` and `data_stream.namespace` falls back to `default`.

The target data stream name is constructed as `metrics-${data_stream.dataset}.otel-${data_stream.namespace}`.

## Limitations

* Histograms are only supported in delta temporality. Set the temporality preference to delta in your SDKs, or use the [`cumulativetodelta` processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/cumulativetodeltaprocessor) to avoid cumulative histograms to be dropped.
* Exemplars are not supported.
7 changes: 4 additions & 3 deletions manage-data/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ toc:
children:
- file: data-store/data-streams/quickstart-tsds.md
- file: data-store/data-streams/set-up-tsds.md
- file: data-store/data-streams/tsds-ingest-otlp.md
- file: data-store/data-streams/downsampling-time-series-data-stream.md
children:
- file: data-store/data-streams/downsampling-concepts.md
- file: data-store/data-streams/run-downsampling.md
- file: data-store/data-streams/query-downsampled-data.md
- file: data-store/data-streams/advanced-topics-tsds.md
children:
- file: data-store/data-streams/time-bound-tsds.md
children:
- file: data-store/data-streams/time-bound-tsds.md
- file: data-store/data-streams/reindex-tsds.md
- file: data-store/data-streams/logs-data-stream.md
- file: data-store/data-streams/failure-store.md
Expand Down Expand Up @@ -167,4 +168,4 @@ toc:
- file: migrate/migrate-from-a-self-managed-cluster-with-a-self-signed-certificate-using-remote-reindex.md
- file: migrate/migrate-internal-indices.md
- file: migrate/migrate-data-between-elasticsearch-clusters-with-minimal-downtime.md
- file: use-case-use-elasticsearch-to-manage-time-series-data.md
- file: use-case-use-elasticsearch-to-manage-time-series-data.md
Loading