-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[exporter/elasticsearch] Change default mapping::mode to otel
#38458
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
Changes from 6 commits
39da605
8903e55
3928bbb
abc9c08
620bb5a
42c5a0c
f4429b5
a9c0732
6094b00
0211be9
0a797ff
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 |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Use this changelog template to create an entry for release notes. | ||
|
|
||
| # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
| change_type: breaking | ||
|
|
||
| # The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
| component: elasticsearchexporter | ||
|
|
||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: Change default `mapping::mode` config to `otel` | ||
|
|
||
| # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
| issues: [37241] | ||
|
|
||
| # (Optional) One or more lines of additional information to render under the primary note. | ||
| # These lines will be padded with 2 spaces and then inserted directly into the document. | ||
| # Use pipe (|) for multiline entries. | ||
| subtext: To retain the old behavior, explicitly set `mapping::mode` to `none`. | ||
|
|
||
| # If your change doesn't affect end users or the exported elements of any package, | ||
| # you should instead start your pull request title with [chore] or use the "Skip Changelog" label. | ||
| # Optional: The change log or logs in which this entry should be included. | ||
| # e.g. '[user]' or '[user, api]' | ||
| # Include 'user' if the change is relevant to end users. | ||
| # Include 'api' if there is a change to a library API. | ||
| # Default: '[user]' | ||
| change_logs: [user] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -158,7 +158,7 @@ The Elasticsearch exporter supports several document schemas and preprocessing | |
| behaviours, which may be configured through the following settings: | ||
|
|
||
| - `mapping`: | ||
| - `mode` (default=none): The default mapping mode. Valid modes are: | ||
| - `mode` (default=otel): The default mapping mode. Valid modes are: | ||
| - `none` | ||
| - `ecs` | ||
| - `otel` | ||
|
|
@@ -177,7 +177,12 @@ See below for a description of each mapping mode. | |
|
|
||
| #### OTel mapping mode | ||
|
|
||
| Requires Elasticsearch 8.12 or above. | ||
| The default and recommended "OTel-native" mapping mode. | ||
|
|
||
| Requires Elasticsearch 8.12 or above[^1], works best with Elasticsearch 8.16 or above[^2]. | ||
|
|
||
| [^1]: as it uses the undocumented `require_data_stream` bulk API parameter supported from Elasticsearch 8.12 | ||
| [^2]: Elasticsearch 8.16 contains a built-in `otel-data` plugin | ||
|
Member
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. hi, Is there a link to the relevant introduction?
Contributor
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. Here's a link to the initial PR: elastic/elasticsearch#111091 |
||
|
|
||
| In `otel` mapping mode, the Elasticsearch Exporter stores documents in Elastic's preferred | ||
| "OTel-native" schema. In this mapping mode, documents use the original attribute names and | ||
|
|
@@ -188,9 +193,7 @@ and `data_stream.namespace`. Instead of serializing these values under the `*att | |
| they are put at the root of the document, to conform with the conventions of the data stream naming | ||
| scheme that maps these as `constant_keyword` fields. | ||
|
|
||
| `data_stream.dataset` will always be appended with `.otel`. It is recommended to use with | ||
| `*_dynamic_index::enabled: true` (e.g. `logs_dynamic_index::enabled`) to route documents to data stream | ||
| `${data_stream.type}-${data_stream.dataset}-${data_stream.namespace}`. | ||
| `data_stream.dataset` will always be appended with `.otel` if [dynamic data stream routing mode](#elasticsearch-document-routing) is active. | ||
|
Contributor
Author
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. expecting a conflict with #38500 . Can be resolved once either PR is merged. |
||
|
|
||
| Span events are stored in separate documents. They will be routed with `data_stream.type` set to | ||
| `logs` if `traces_dynamic_index::enabled` is `true`. | ||
|
|
||
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.
For a user that uses the Elasticsearch exporter with Elasticsearch < 8.12 and the default mapping mode, they will stop seeing their data in Elasticsearch, and start seeing rejection logs in the collector. This is not ideal.
On the other hand, 8.12 is over a year old (January 2024) and the officially supported versions of Elasticsearch are currently 8.16 and 8.17.
I'm on board with this change as it makes new users' experience much better. Also the remediation is easy for affected users: add a configuration flag, as described in the changelog entry.