Skip to content

Commit 3fc8503

Browse files
felixbarnytheletterfkkrik-es
authored
Add OTLP docs (#3360)
Adds docs for the new OTLP endpoint added via elastic/elasticsearch#133057 Closes #3363 --------- Co-authored-by: Fabrizio Ferri-Benedetti <[email protected]> Co-authored-by: Kostas Krikellas <[email protected]>
1 parent a49050d commit 3fc8503

File tree

6 files changed

+126
-8
lines changed

6 files changed

+126
-8
lines changed

manage-data/data-store/data-streams/advanced-topics-tsds.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ products:
1212
This section contains information about advanced concepts and operations for [time series data streams](/manage-data/data-store/data-streams/time-series-data-stream-tsds.md):
1313

1414
- [](/manage-data/data-store/data-streams/time-bound-tsds.md)
15-
- [](/manage-data/data-store/data-streams/reindex-tsds.md)
15+
- [](/manage-data/data-store/data-streams/reindex-tsds.md)
16+
- [](/manage-data/data-store/data-streams/tsds-ingest-otlp.md)

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ Use this quickstart to set up a time series data stream (TSDS), ingest a few doc
1313

1414
A _time series_ is a sequence of data points collected at regular time intervals. For example, you might track CPU usage or stock price over time. This quickstart uses simplified weather sensor readings to show how a TSDS helps you analyze metrics data over time.
1515

16+
::::{note}
17+
If you're looking to ingest OpenTelemetry metrics,
18+
follow the [OpenTelemetry quickstarts](/solutions/observability/get-started/opentelemetry/quickstart/index.md).
19+
This allows you to start sending data into a TSDS without having to worry about manually setting up data streams or configuring mappings.
20+
::::
21+
1622
## Prerequisites
1723

1824
* Access to [{{dev-tools-app}} Console](/explore-analyze/query-filter/tools/console.md) in {{kib}}, or another way to make {{es}} API requests
@@ -320,4 +326,4 @@ For more information about the APIs used in this quickstart, review the {{es}} A
320326

321327
* [Bulk API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)
322328
* [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)
329+
* [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: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ 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+
::::{note}
17+
If you're looking to ingest OpenTelemetry metrics,
18+
follow the [OpenTelemetry quickstarts](/solutions/observability/get-started/opentelemetry/quickstart/index.md).
19+
This allows you to start sending data into a TSDS without having to worry about manually setting up data streams or configuring mappings.
20+
::::
1521

1622
## Before you begin [tsds-prereqs]
1723

@@ -188,4 +194,4 @@ Now that you've set up a time series data stream, you can manage and use it like
188194
* [Use a data stream](use-data-stream.md) for indexing and searching
189195
* [Change data stream settings](modify-data-stream.md#data-streams-change-mappings-and-settings) as needed
190196
* 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)
197+
* 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 using 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: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
navigation_title: "OTLP/HTTP endpoint"
3+
applies_to:
4+
stack: preview 9.2
5+
deployment:
6+
self:
7+
products:
8+
- id: elasticsearch
9+
---
10+
11+
# OTLP/HTTP endpoint
12+
13+
:::{important}
14+
The recommended way to send OTLP data for most use cases is through an OpenTelemetry Collector in [Gateway mode](elastic-agent://reference/edot-collector/config/default-config-standalone.md#gateway-mode) or, if you're on {{ecloud}}, directly to the [{{motlp}}](opentelemetry:/reference/motlp.md). Refer to [Best practices](#best-practices) for more details.
15+
:::
16+
17+
In addition to the ingestion of metrics data through the bulk API,
18+
{{es}} offers an alternative way to ingest data through the [OpenTelemetry Protocol (OTLP)](https://opentelemetry.io/docs/specs/otlp).
19+
20+
The endpoint is available under `/_otlp/v1/metrics`.
21+
22+
Ingesting metrics data using the OTLP endpoint has the following advantages:
23+
24+
* Improved ingestion performance, especially if the data contains many resource attributes.
25+
* Simplified index mapping:
26+
there's no need to manually create data streams, index templates, or define dimensions and metrics.
27+
Metrics are dynamically mapped using the metadata included in the OTLP requests.
28+
29+
:::{note}
30+
{{es}} only supports [OTLP/HTTP](https://opentelemetry.io/docs/specs/otlp/#otlphttp),
31+
not [OTLP/gRPC](https://opentelemetry.io/docs/specs/otlp/#otlpgrpc).
32+
:::
33+
34+
## How to send data to the OTLP endpoint
35+
36+
To send data from an OpenTelemetry Collector to the {{es}} OTLP endpoint,
37+
use the [`OTLP/HTTP` exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlphttpexporter).
38+
This is an example configuration:
39+
40+
```yaml
41+
extensions:
42+
basicauth/elasticsearch:
43+
client_auth:
44+
username: <user>
45+
password: <password>
46+
exporters:
47+
otlphttp/elasticsearch-metrics:
48+
endpoint: <es_endpoint>/_otlp
49+
sending_queue:
50+
enabled: true
51+
sizer: bytes
52+
queue_size: 50_000_000 # 50MB uncompressed
53+
block_on_overflow: true
54+
batch:
55+
flush_timeout: 1s
56+
min_size: 1_000_000 # 1MB uncompressed
57+
max_size: 4_000_000 # 4MB uncompressed
58+
auth:
59+
authenticator: basicauth/elasticsearch
60+
service:
61+
extensions: [basicauth/elasticsearch]
62+
pipelines:
63+
metrics:
64+
exporters: [otlphttp/elasticsearch-metrics]
65+
receivers: ...
66+
```
67+
68+
The supported options for `compression` are `gzip` (default value of the `OTLP/HTTP` exporter) and `none`.
69+
70+
% TODO we might actually also support snappy and zstd, test and update accordingly)
71+
72+
To track metrics in your custom application,
73+
use the [OpenTelemetry language SDK](https://opentelemetry.io/docs/getting-started/dev/) of your choice.
74+
75+
:::{note}
76+
Only `encoding: proto` is supported, which the `OTLP/HTTP` exporter uses by default.
77+
:::
78+
79+
## Best practices
80+
81+
Don't 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.
82+
83+
On {{ecloud}}, use the [{{motlp}}](opentelemetry:/reference/motlp.md) and for self-managed use cases, you can use the [Elastic Distribution of OpenTelemetry Collector](elastic-agent:/reference/edot-collector/index.md).
84+
85+
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).
86+
87+
## Send data to different data streams
88+
89+
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:
90+
91+
- `data_stream.dataset` or `data_stream.namespace` in attributes, with the following order of precedence: data point attribute -> scope attribute -> resource attribute
92+
- Otherwise, if the scope name contains `/receiver/<somereceiver>`, `data_stream.dataset` is set to the receiver name.
93+
- Otherwise, `data_stream.dataset` falls back to `generic` and `data_stream.namespace` falls back to `default`.
94+
95+
The target data stream name is constructed as `metrics-${data_stream.dataset}.otel-${data_stream.namespace}`.
96+
97+
## Limitations
98+
99+
* Only the OTLP metrics endpoint (`/_otlp/v1/metrics`) is supported.
100+
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),
101+
such as the [Elastic Distribution of OpenTelemetry (EDOT) Collector](opentelemetry:/reference/edot-collector/index.md).
102+
* 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.
103+
* Exemplars are not supported.

manage-data/toc.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ toc:
2121
- file: data-store/data-streams/run-downsampling.md
2222
- file: data-store/data-streams/query-downsampled-data.md
2323
- file: data-store/data-streams/advanced-topics-tsds.md
24-
children:
25-
- file: data-store/data-streams/time-bound-tsds.md
24+
children:
25+
- file: data-store/data-streams/time-bound-tsds.md
2626
- file: data-store/data-streams/reindex-tsds.md
27+
- file: data-store/data-streams/tsds-ingest-otlp.md
2728
- file: data-store/data-streams/logs-data-stream.md
2829
- file: data-store/data-streams/failure-store.md
2930
children:
@@ -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)