Commit graph

34 commits

Author SHA1 Message Date
Niels Bauman
ff1c9b7c6c
Make IndexTemplateRegistry project-aware (#126986)
Ensures the `IndexTemplatesRegistry` installs resources in every project
in the cluster.

ES-10055
2025-04-24 12:22:18 +02:00
Carson Ip
5860ccb113
[otel-data] Bump plugin version to release _metric_names_hash changes (#126850)
Bump otel-data plugin version as #120952 missed the bump.
2025-04-16 10:27:19 +01:00
Gergely Kalapos
88996bc01d
[otel-data] Add profiler_stack_trace_ids as counted_keyword to otel-data mappings (#125608)
* Add profiler_stack_trace_ids as counted_keyword to otel-data mappings

* Change prefix for profiler_stack_trace_ids
2025-04-04 09:44:41 +01:00
Felix Barnsteiner
5e8865deac
Add _metric_names_hash field to OTel metric mappings (#120952)
If metrics that have the same timestamp and dimensions aren't grouped into the same document, ES will consider them to be a duplicate.
The _metric_names_hash field will be set by the OTel ES exporter.
As it's mapped as a time_series_dimensions, it creates a different _tsid for documents with different sets of metrics.
The tradeoff is that if the composition of the metrics grouping changes over time, a different _tsid will be created.
That has an impact on the rate aggregation for counters.
2025-02-18 18:30:37 +01:00
Felix Barnsteiner
fdab1ff386
Consistent mapping for OTel log and event bodies (#120547) 2025-01-22 18:18:47 +01:00
Felix Barnsteiner
2e50ef82fc
Map scope.name as a dimension (#120590) 2025-01-22 11:51:45 +00:00
Felix Barnsteiner
90bfdbc2bc
Increase field limit for OTel metrics to 10 000 (#120591)
The default field limit of 1000 seems undersized, especially for the default data stream.
Each distinct attribute/dimension name and metric name count towards that limit
2025-01-22 11:46:12 +00:00
Simon Cooper
a2d84b1b90
Remove assumed features in server for 9.0 (#119946)
All features added before 8.18 can now be assumed and removed in 9.0
2025-01-15 08:37:04 +00:00
Felix Barnsteiner
14c21f203f
Add missing traces ilm policy for OTel traces data streams (#119449) 2025-01-09 08:00:02 +01:00
Felix Barnsteiner
afda404524
Optimized index sorting for OTel logs (#119504) 2025-01-08 11:47:21 +01:00
Felix Barnsteiner
a268deeb44
Add mapping for event_name for OTel logs (#119495) 2025-01-03 15:32:44 +00:00
Rene Groeschke
ba61f8c7f7
Update Gradle wrapper to 8.12 (#118683)
This updates the gradle wrapper to 8.12

We addressed deprecation warnings due to the update that includes:

- Fix change in TestOutputEvent api
- Fix deprecation in groovy syntax
- Use latest ospackage plugin containing our fix
- Remove project usages at execution time
- Fix deprecated project references in repository-old-versions
2024-12-30 15:34:24 +01:00
Martijn van Groningen
2f0b095b5d
Stop using _source.mode attribute in traces-otel builtin template (#117487)
The traces-otel@mappings component template is configured to use logsdb. No need to configure source mode separately.
2024-11-25 16:45:36 +01:00
Simon Cooper
c832572709
Remove some historical features (#116926)
Historical features are now trivially true on v9 - so we can remove the features, and the check.
Historical features do not affect cluster state, so this has no compatibility restrictions.
2024-11-18 14:33:05 +00:00
Gergely Kalapos
c45fcad010
Add orchestrator.cluster.name -> k8s.cluster.name mapping (#116421) 2024-11-08 08:54:09 +01:00
Gergely Kalapos
37c7137f39
[otel-data] Add more kubernetes aliases (#115429)
* Add more kubernetes aliases

* Update docs/changelog/115429.yaml

* Review feedback

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-24 15:49:45 +02:00
Salvatore Campagna
9bf6e3b0ba
Inject the host.name field mapping only if required for logsdb index mode (#114573)
Here we check for the existence of a `host.name` field in index sort settings
when the index mode is `logsdb` and decide to inject the field in the mapping
depending on whether it exists or not. By default `host.name` is required for
sorting in LogsDB. This reduces the chances for errors at mapping or template
composition time as a result of injecting the `host.name` field only if strictly
required. A user who wants to override index sort settings without including
a `host.name` field would be able to do so without finding an additional
`host.name` field in the mappings (injected automatically). If users override the
sort settings and a `host.name` field is not included we don't need
to inject such field since sorting does not require it anymore.

As a result of this change we have the following:
* the user does not provide any index sorting configuration: we are responsible for injecting the default sort fields and their mapping (for `logsdb`)
* the user explicitly provides non-empty index sorting configuration: the user is also responsible for providing correct mappings and we do not modify index sorting or mappings

Note also that all sort settings `index.sort.*` are `final` which means doing this
check once, when mappings are merged at template composition time, is enough.
2024-10-16 16:12:56 +02:00
Felix Barnsteiner
80c163e70e
OTel mappings: avoid metrics to be rejected when attributes are malformed (#114856) 2024-10-16 09:10:09 +02:00
Gergely Kalapos
d94fbcb01a
Add alias event.dataset -> data_stream.dataset (#114642) 2024-10-14 10:33:36 +02:00
Felix Barnsteiner
e221c0357e
Add mappings for OTel event body (#114332)
Also changes mappings from body_* to body.*
2024-10-09 11:57:31 +02:00
Gergely Kalapos
991cff9912
[otel-data] Hide 10m and 60m aggregated metrics generated for the APM UI (#114042)
* Hide aggregated metrics generated for the APM UI

* Update 30_aggregated_metrics_tests.yml

* Review feedback

- Introduced templates for 1 minute aggregations
- Moved dynamic templates `ecs_ip` and `all_strings_to_keywords` into a dedicated file and now I pull the file in instead of repeating them
- Introduced `metrics-[x]m.otel@custom`
- Added tests with terms aggregation that assert by default 1 bucket (only 1m) with metricsset.interval, and with allowing hidden indices it's 3 buckets (1m, 10m, 60m)

* Update 30_aggregated_metrics_tests.yml

Simplify - no need to separate tests for the 3bucket queries.

* Rename metrics-otel-fixed@mappings to ecs-tsdb@mappings

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-04 23:10:37 +02:00
Gergely Kalapos
c20f5f9a5d
[otel-data] Add @timestamp as sort field for logs and traces (#114049)
* Add @timestamp as sort field for logs and traces

* Change order of sort fields

* Adapt tests
2024-10-04 14:22:28 +02:00
Felix Barnsteiner
4438e49550
Add attribute type conflict handling test (#114100) 2024-10-04 19:25:04 +10:00
Kostas Krikellas
dd2024881d
Add object param for keeping synthetic source (#113690)
* Add object param for keeping synthetic source

* Update docs/changelog/113690.yaml

* fix merging

* add tests

* merge

* fix randomized tests

* add documentation

* dedup id in docs

* update documentation

* update documentation

* fix bwc

* fix bwc

* fix unintended

* Revert "fix bwc"

This reverts commit 18dc913eee.

* Revert "fix bwc"

This reverts commit f4ddb0e5e5.

* add missing test

* fix transform

* fix transform

* fix transform

* fix transform

* fix transform
2024-10-03 21:19:04 +03:00
Martijn van Groningen
372cbb1e97
Change synthetic_source_keep setting's default (#113957)
Incase of logsdb, the `index.mapping.synthetic_source_keep` setting should default to `arrays`. Otherwise it should default to `none`.
2024-10-03 17:49:00 +02:00
Gergely Kalapos
af7c81efd7
[otel-plugin] Add aliases for spanevent/logrecord exceptions (#113636)
* Add tests for exceptions

* Adapt aliases and move into a separate file

* Clarify description in alias files

* Handling stacktrace

* Move error aliases to logs-otel@mappings.yaml

* Update resources.yaml

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-02 09:39:59 +02:00
Carson Ip
f6a5252436
x-pack/plugin/otel-data: Fix dynamic template summary and summary_minmax (#113868)
<!-- Thank you for your interest in and contributing to Elasticsearch!
There are a few simple things to check before submitting your pull
request that can help with the review process. You should delete these
items from your submission, but they are here to help bring them to your
attention. --> Fix error `failed to parse: class java.lang.String cannot
be cast to class java.util.List (java.lang.String and java.util.List are
in module java.base of loader 'bootstrap')`
2024-10-02 01:59:51 +10:00
Gergely Kalapos
644fd047c9
Make xpack.otel_data.registry.enabled default to true (#113468)
* Make xpack.otel_data.registry.enabled default to true

* Update build.gradle

* Disable otel-data plugin for tests where it's not relevant

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-01 16:29:37 +02:00
Vishal Raj
649acc494c
[plugin/otel-data] Add dynamic template for summary with min, max (#113791) 2024-10-01 10:29:32 +01:00
Gergely Kalapos
55ef5e6ba1
Remove dynamic templates from otel-plugin that set index:false (#113409)
* Remove dynamic templates from otel-plugin that set `index:false`

* Update x-pack/plugin/otel-data/src/yamlRestTest/resources/rest-api-spec/test/20_metrics_tests.yml

Co-authored-by: Felix Barnsteiner <felixbarny@users.noreply.github.com>

* Remove unused dynamic templates

* Update metrics-otel@mappings.yaml

---------

Co-authored-by: Felix Barnsteiner <felixbarny@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-09-26 08:36:58 +02:00
Felix Barnsteiner
8d223cbf7a
Add support for multi-value dimensions (#112645)
Closes https://github.com/elastic/elasticsearch/issues/110387

Having this in now affords us not having to introduce version checks in
the ES exporter later. We can simply use the same serialization logic
for metric attributes as we do for other signals. This also enables us
to properly map `*.ip` fields to the ip field type as ip fields
containing a list of IPs are not converted to a comma-separated list.
2024-09-23 17:31:18 +10:00
Mark Vieira
a59c182f9f
Add AGPLv3 as a supported license 2024-09-13 15:29:46 -07:00
Felix Barnsteiner
e1b42090ec
Allow dimension fields to have multiple values in standard and logsdb index mode (#112345)
Fixes https://github.com/elastic/elasticsearch/issues/112232 Fixes
https://github.com/elastic/elasticsearch/issues/112239
2024-09-05 04:03:23 +10:00
Gergely Kalapos
4e1a84c883
x-pack/plugin/otel: introduce x-pack-otel plugin (#111091)
* Add YamlTemplateRegistry and OtelIndexTemplateRegistry with resource YAML files

* Fix traces-otel template

* Adding first yml tests

* Base APMIndexTemplateRegistry on YamlTemplateRegistry

* Update OTelPlugin.java

* Update APMIndexTemplateRegistry.java

* Update YamlIngestPipelineConfig.java

* Adding traces tests

* Update x-pack/plugin/otel-data/src/main/resources/component-templates/ecs-tsdb@mappings.yaml

Co-authored-by: Felix Barnsteiner <felixbarny@users.noreply.github.com>

* Add mapper-version

* Fix code-style

* Rename `status.status_code` to `status.code`

* Update otel@mappings.yaml

Revert back to date due to missing support in ES|QL for date_nanos

* Move dynamic_templates to metrics@mappings in core

* Run gradlew :x-pack:plugin:core:spotlessApply

* Update x-pack/plugin/otel-data/src/main/resources/component-templates/metrics-otel@mappings.yaml

Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>

* Update 20_metic_tests.yml

Workaround for TSDB timestamp issue: we push a custom template with higher priority and set  time_series.start_time.

* Update CODEOWNERS

Adding obs-ds-intake-services as owner of the new otel-data plugin.

Since we had some changes, also updating the owner of apm-data to the same team.

* Change dynamic: strict to false

* Skip "Reject invalid top level field" test

* Update 20_metic_tests.yml

* Add boolean as dimension test (skipping it for now)

* Add booleans_to_keywords and enable corresponding test

* Remove processor.event top level mapping

Reason: for metrics and logs we can rely on the name of the datastream. For spans vs. transactions there are other fields we can use.

* Remove booleans_to_keywords

Because booleans are supported now as dimension on TSDB

* Add alias service.language.name -> telemetry.sdk.language

* cleanup

* Update README.md

* Update README.md

* Update docs/changelog/111091.yaml

* Move traces@settings and traces@mappings to core

* Update traces-otel@mappings.yaml

* Review feedback

* Adapt `match` style in tests

* Update docs/changelog/111091.yaml

* Apply suggestions from code review

Co-authored-by: Vishal Raj <vishal.raj@elastic.co>

* Update x-pack/plugin/otel-data/src/main/resources/component-templates/traces-otel@mappings.yaml

Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>

* Changing trace_flags to long

Related discussion: https://github.com/elastic/elasticsearch/pull/111091#discussion_r1706698491

* Remove trace_flags

see: https://github.com/elastic/opentelemetry-dev/pull/368#pullrequestreview-2229633970

* Apply suggestions from code review

Co-authored-by: Andrew Wilkins <axwalk@gmail.com>

* Review feedback

* Add store_array_source for span links

* Define constant `data_stream.type` in `template.yaml`s

* Create package-info.java

* Move ecs-tsdb@mappings to index template

Add test to verify that @custom template can add dynamic templates with a higher precedence

* Update metrics@mappings.json

Remove summary_gauge and summary_counter since they are covered by summary_metrics

* Move clusterService.getClusterSettings().addSettingsUpdateConsumer to registry

* Fix code-style

* Update x-pack/plugin/otel-data/src/yamlRestTest/resources/rest-api-spec/test/20_logs.tests.yml

Co-authored-by: Felix Barnsteiner <felixbarny@users.noreply.github.com>

* Enable logsdb

* Update traces@settings.json

No lifecycle needed for OTel at this point

---------

Co-authored-by: Felix Barnsteiner <felixbarny@users.noreply.github.com>
Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>
Co-authored-by: Vishal Raj <vishal.raj@elastic.co>
Co-authored-by: Andrew Wilkins <axwalk@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Felix Barnsteiner <felix.barnsteiner@elastic.co>
2024-08-19 09:24:47 +02:00