-
Notifications
You must be signed in to change notification settings - Fork 153
Add OTLP docs #3360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: mw-tsds-final-countdown
Are you sure you want to change the base?
Add OTLP docs #3360
Changes from 11 commits
30a00fb
2e20d91
a570a5f
e86aefe
81eb866
4479c8c
355b3a6
6553bf7
24fb84b
d8936ab
f3d50e9
d4c1b25
457819f
eff6581
4018d02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,13 @@ 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). | ||
felixbarny marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
::::{note} | ||
If you're looking to ingest OpenTelemetry metrics, | ||
follow the [OpenTelemetry quickstarts](/solutions/observability/get-started/opentelemetry/quickstart/index.md). | ||
This allows you to start sending data into a TSDS without having to worry about manually setting up data streams or configuring mappings. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe: "For more details on how this is handled in Elasticsearch, check out [OTLP/HTTP endpoint There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After this is merged into my branch, I'll make sure everything matches Elastic docs style (this note can be shorter and more direct) |
||
:::: | ||
|
||
## Before you begin [tsds-prereqs] | ||
|
||
|
@@ -188,4 +194,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 |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
navigation_title: "OTLP/HTTP endpoint" | ||
applies_to: | ||
stack: preview 9.2 | ||
theletterf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
deployment: | ||
self: | ||
products: | ||
- id: elasticsearch | ||
--- | ||
|
||
# OTLP/HTTP endpoint | ||
|
||
:::{important} | ||
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. | ||
::: | ||
|
||
In addition to the ingestion of metrics data through the bulk API, | ||
{{es}} offers an alternative way to ingest data through 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 data streams, index templates, or define dimensions and metrics. | ||
Metrics are dynamically mapped using the metadata included in the OTLP requests. | ||
|
||
:::{note} | ||
{{es}} only supports [OTLP/HTTP](https://opentelemetry.io/docs/specs/otlp/#otlphttp), | ||
not [OTLP/gRPC](https://opentelemetry.io/docs/specs/otlp/#otlpgrpc). | ||
::: | ||
|
||
## 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: | ||
felixbarny marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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 | ||
``` | ||
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. | ||
|
||
:::{note} | ||
Only `encoding: proto` is supported, which the `OTLP/HTTP` exporter uses by default. | ||
::: | ||
|
||
## Best practices | ||
|
||
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. | ||
|
||
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). | ||
|
||
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). | ||
|
||
## 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 | ||
|
||
* Only the OTLP metrics endpoint (`/_otlp/v1/metrics`) is supported. | ||
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), | ||
such as the [Elastic Distribution of OpenTelemetry (EDOT) Collector](opentelemetry:/reference/edot-collector/index.md). | ||
* 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. | ||
felixbarny marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* Exemplars are not supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One the fence about having it here as well.. will defer to @marciw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, linking from the TSDS quickstart to the OTel quickstart kinda makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with the addition, except it kind of takes over the top of the page. But I can maybe work on making it a bit smaller -- OK as is for now