-
Notifications
You must be signed in to change notification settings - Fork 152
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
Open
felixbarny
wants to merge
11
commits into
elastic:mw-tsds-final-countdown
Choose a base branch
from
felixbarny:otlp
base: mw-tsds-final-countdown
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+119
−7
Open
Add OTLP docs #3360
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
30a00fb
Add OTLP docs
felixbarny 2e20d91
Fix links to otel docs
felixbarny a570a5f
Apply suggestions from code review
theletterf e86aefe
Update tsds-ingest-otlp.md
theletterf 81eb866
Add mapping hints section
felixbarny 4479c8c
Apply suggestions from code review
felixbarny 355b3a6
Address review comments
felixbarny 6553bf7
Promote OTEL based ingestion but put the OTLP/HTTP endpoint under adv…
felixbarny 24fb84b
Small content tweaks
theletterf d8936ab
Add word
theletterf f3d50e9
Fix article
theletterf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
navigation_title: "Ingest OTLP metrics" | ||
felixbarny marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
applies_to: | ||
stack: preview 9.2 | ||
theletterf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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. | ||
felixbarny marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Using the OTLP endpoint, metrics are dynamically mapped using the metadata included in the OTLP requests. | ||
felixbarny marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
:::{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). | ||
felixbarny marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.