-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[exporter/elasticsearch] Implement receiver-based routing under *_dynamic_index config #35417
[exporter/elasticsearch] Implement receiver-based routing under *_dynamic_index config #35417
Conversation
@@ -121,21 +121,21 @@ This can be customised through the following settings: | |||
|
|||
- `logs_dynamic_index` (optional): uses resource, scope, or log record attributes to dynamically construct index name. | |||
- `enabled`(default=false): Enable/Disable dynamic index for log records. If `data_stream.dataset` or `data_stream.namespace` exist in attributes (precedence: log record attribute > scope attribute > resource attribute), they will be used to dynamically construct index name in the form `logs-${data_stream.dataset}-${data_stream.namespace}`. Otherwise, if | |||
`elasticsearch.index.prefix` or `elasticsearch.index.suffix` exist in attributes (precedence: resource attribute > scope attribute > log record attribute), they will be used to dynamically construct index name in the form `${elasticsearch.index.prefix}${logs_index}${elasticsearch.index.suffix}`. Otherwise, the index name falls back to `logs-generic-default`, and `logs_index` config will be ignored. Except for prefix/suffix attribute presence, the resulting docs will contain the corresponding `data_stream.*` fields. | |||
`elasticsearch.index.prefix` or `elasticsearch.index.suffix` exist in attributes (precedence: resource attribute > scope attribute > log record attribute), they will be used to dynamically construct index name in the form `${elasticsearch.index.prefix}${logs_index}${elasticsearch.index.suffix}`. Otherwise, if scope name matches regex `/receiver/(\w*receiver)`, `data_stream.dataset` will be capture group #1. Otherwise, the index name falls back to `logs-generic-default`, and `logs_index` config will be ignored. Except for prefix/suffix attribute presence, the resulting docs will contain the corresponding `data_stream.*` fields. |
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.
This will change the way data is routed for users who have enabled a (logs|metrics|traces)_dynamic_index
property. Previously, e.g. metrics from the Host Metrics receiver were sent to metrics-generic-default
. After this change, they will be sent to metrics-hostmetrics-default
, correct? This could potentially break a user's setup, assuming they have e.g. some alerts set up querying for host metrics from the metrics-generic-default
data stream?
Perhaps we should change the changelog entry's change_type
from enhancement
to breaking
?
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.
Changed to breaking
…amic_index config (open-telemetry#35417) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Implement receiver-based routing under *_dynamic_index config. e.g. Set data_stream.dataset to hostmetricsreceiver (or hostmetricsreceiver.otel in the OTel output mode) for the scope name github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/cpuscraper **Link to tracking Issue:** <Issue number if applicable> Fixes open-telemetry#34246 **Testing:** <Describe what testing was performed and which tests were added.> **Documentation:** <Describe the documentation added.>
Description:
Implement receiver-based routing under *_dynamic_index config.
e.g. Set data_stream.dataset to hostmetricsreceiver (or hostmetricsreceiver.otel in the OTel output mode) for the scope name github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/cpuscraper
Link to tracking Issue:
Fixes #34246
Testing:
Documentation: