Skip to content

Commit 30a00fb

Browse files
committed
Add OTLP docs
1 parent 0b0de90 commit 30a00fb

File tree

5 files changed

+111
-7
lines changed

5 files changed

+111
-7
lines changed

manage-data/data-store/data-streams/quickstart-tsds.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,10 @@ This quickstart introduced the basics of time series data streams. To learn more
315315

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

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

321322
* [Bulk API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)
322323
* [Index template API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template)
323-
* [Search API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search)
324+
* [Search API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search)

manage-data/data-store/data-streams/set-up-tsds.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ products:
1111

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

14-
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).
14+
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).
15+
16+
For a simplified setup that doesn't require manually mapping dimension and metric fields via index templates,
17+
have a look at the [OpenTelemetry Protocol (OTLP)-based data ingestion](tsds-ingest-otlp.md).
1518

1619
## Before you begin [tsds-prereqs]
1720

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

manage-data/data-store/data-streams/time-series-data-stream-tsds.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ You can use the {{esql}} [`TS` command](elasticsearch://reference/query-language
117117

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

122123
% suppress anchor warnings until chicken-and-egg resolved
@@ -125,4 +126,4 @@ You can use the {{esql}} [`TS` command](elasticsearch://reference/query-language
125126
##### [tsds-look-back-time]
126127
##### [time-bound-indices]
127128
##### [dimension-based-routing]
128-
##### [tsds-accepted-time-range]
129+
##### [tsds-accepted-time-range]
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
navigation_title: "Ingest OTLP metrics"
3+
applies_to:
4+
stack: preview 9.2
5+
serverless: preview
6+
products:
7+
- id: elasticsearch
8+
---
9+
10+
# Ingest metrics via the OpenTelemetry Protocol (OTLP)
11+
12+
In addition to the ingestion of metrics data via the bulk API,
13+
{{es}} offers an alternative way to ingest data via the [OpenTelemetry Protocol (OTLP)](https://opentelemetry.io/docs/specs/otlp).
14+
15+
The endpoint is available under `/_otlp/v1/metrics`.
16+
17+
Ingesting metrics data via this endpoint has the following advantages:
18+
* Improved ingestion performance, especially if the data contains many resource attributes.
19+
* Simplified index mapping:
20+
there's no need to manually create an index template, or define dimensions and metrics.
21+
Using the OTLP endpoint, metrics are dynamically mapped using the metadata included in the OTLP requests.
22+
23+
## How to send data to the OTLP endpoint
24+
25+
To send data from an OpenTelemetry collector to the {{es}} OTLP endpoint,
26+
use the [`OTLP/HTTP` exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlphttpexporter).
27+
This is an example configuration:
28+
29+
```yaml
30+
extensions:
31+
basicauth/elasticsearch:
32+
client_auth:
33+
username: <user>
34+
password: <password>
35+
exporters:
36+
otlphttp/elasticsearch:
37+
endpoint: <es_endpoint>/_otlp
38+
sending_queue:
39+
enabled: true
40+
sizer: requests
41+
queue_size: 5000
42+
block_on_overflow: true
43+
batch:
44+
flush_timeout: 5s
45+
sizer: bytes
46+
min_size: 2_000_000
47+
max_size: 5_000_000
48+
auth:
49+
authenticator: basicauth/elasticsearch
50+
```
51+
Note that at this point, only `encoding: proto` is supported,
52+
which the `OTLP/HTTP` exporter uses by default.
53+
54+
The supported options for `compression` are `gzip` (default value of the `OTLP/HTTP` exporter) and `none`.
55+
56+
[//]: # (TODO we might actually also support snappy and zstd, test and update accordingly)
57+
58+
To track metrics in your custom application,
59+
use the [OpenTelemetry language SDK](https://opentelemetry.io/docs/getting-started/dev/) of your choice.
60+
61+
## When not to use the {{es}} OTLP endpoint
62+
63+
On Elastic Cloud, use the [Elastic Cloud Managed OTLP Endpoint](opentelemetry::/reference/motlp.md) instead of connecting directly to the Elasticsearch OTLP endpoint.
64+
65+
It's not recommended to send metrics from applications directly to the Elasticsearch OTLP endpoint,
66+
especially if there are many individual applications that each periodically send a small amount of metrics.
67+
Instead, send data to an OpenTelemetry collector first.
68+
This helps with handling many connections,
69+
and with creating bigger batches to improve ingestion performance.
70+
For more details on the recommended way to set up OpenTelemetry-based data ingestion,
71+
have a look at the [EDOT reference architecture](opentelemetry::/reference/architecture/index.md).
72+
73+
At this point, {{es}} only supports the OTLP metrics endpoint (`/_otlp/v1/metrics`).
74+
Other signals, are not supported as a native {{es}} OTLP endpoint at the moment.
75+
To ingest other signals,
76+
such as logs, traces, and profiles,
77+
use a distribution of the OpenTelemetry collector that includes the [Elasticsearch exporter](opentelemetry::/reference/edot-collector/components/elasticsearchexporter.md),
78+
such as the [Elastic distribution of OpenTelemetry (EDOT) Collector](opentelemetry::/reference/edot-collector/index.md).
79+
80+
## Send data to different data streams
81+
82+
By default, metrics are ingested into the `metrics-generic.otel-default` data stream.
83+
You can influence the target data stream by setting specific attributes on your data:
84+
85+
- `data_stream.dataset` or `data_stream.namespace` in attributes, with the following order of precedence: data point attribute -> scope attribute -> resource attribute
86+
- Otherwise, if the scope name contains `/receiver/<somereceiver>`, `data_stream.dataset` is set to the receiver name.
87+
- Otherwise, `data_stream.dataset` falls back to `generic` and `data_stream.namespace` falls back to `default`.
88+
89+
The target data stream name is constructed as `metrics-${data_stream.dataset}.otel-${data_stream.namespace}`.
90+
91+
## Mapping hints
92+
93+
## Limitations
94+
95+
* Histograms are only supported in delta temporality.
96+
Set the temporality preference to delta in your SDKs,
97+
or use the [`cumulativetodelta` processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/cumulativetodeltaprocessor) to avoid cumulative histograms to be dropped.
98+
* Exemplars are not supported.

manage-data/toc.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ toc:
1515
children:
1616
- file: data-store/data-streams/quickstart-tsds.md
1717
- file: data-store/data-streams/set-up-tsds.md
18+
- file: data-store/data-streams/tsds-ingest-otlp.md
1819
- file: data-store/data-streams/downsampling-time-series-data-stream.md
1920
children:
2021
- file: data-store/data-streams/downsampling-concepts.md
2122
- file: data-store/data-streams/run-downsampling.md
2223
- file: data-store/data-streams/query-downsampled-data.md
2324
- file: data-store/data-streams/advanced-topics-tsds.md
24-
children:
25-
- file: data-store/data-streams/time-bound-tsds.md
25+
children:
26+
- file: data-store/data-streams/time-bound-tsds.md
2627
- file: data-store/data-streams/reindex-tsds.md
2728
- file: data-store/data-streams/logs-data-stream.md
2829
- file: data-store/data-streams/failure-store.md
@@ -167,4 +168,4 @@ toc:
167168
- file: migrate/migrate-from-a-self-managed-cluster-with-a-self-signed-certificate-using-remote-reindex.md
168169
- file: migrate/migrate-internal-indices.md
169170
- file: migrate/migrate-data-between-elasticsearch-clusters-with-minimal-downtime.md
170-
- file: use-case-use-elasticsearch-to-manage-time-series-data.md
171+
- file: use-case-use-elasticsearch-to-manage-time-series-data.md

0 commit comments

Comments
 (0)