Otel agent distro diferentiation in APM telemetry collection#208770
Otel agent distro diferentiation in APM telemetry collection#208770marcogavaz wants to merge 9 commits intoelastic:mainfrom
Conversation
...solutions/observability/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts
Show resolved
Hide resolved
...solutions/observability/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts
Outdated
Show resolved
Hide resolved
...solutions/observability/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts
Outdated
Show resolved
Hide resolved
kpatticha
left a comment
There was a problem hiding this comment.
The code looks good to me, I tested it locally and it works as expected
I left few comments related to the types.
|
Not related to the work of this PR but I've noticed the following code. and when I run my local environment with only otel data (using synthrace) I got the following response I would expect the |
Great, i'll integrate your hints asap! Could we have maybe a meeting together where you show me how you test in local? (like on which data, how you set up the deployment, ...)? It would be great so i can bring also this new knowledge to the rest of observability bi team. I'll send you an invitation! |
|
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
b704464 to
340325a
Compare
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --include-path /api/dashboards --update'
💔 Build Failed
Failed CI StepsTest Failures
Metrics [docs]
History
cc @marcogavaz |
…#210775) ## Summary This PRs follows the [closed PR ](#208770) and Closes https://github.com/elastic/observability-bi/issues/489 As requested in [this comment ](#186281 (comment)) and tracked by the issue #186281 this PR handles main changes introduced to address the request for capturing open-ended OTel distro agent names with patter `opentelemetry/<LANGUAGE>/<DISTRO_NAME>`. These changes ensure that new agent names won’t be dropped in telemetry. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…elastic#210775) ## Summary This PRs follows the [closed PR ](elastic#208770) and Closes elastic/observability-bi#489 As requested in [this comment ](elastic#186281 (comment)) and tracked by the issue elastic#186281 this PR handles main changes introduced to address the request for capturing open-ended OTel distro agent names with patter `opentelemetry/<LANGUAGE>/<DISTRO_NAME>`. These changes ensure that new agent names won’t be dropped in telemetry. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…sue 489 (#210775) (#224160) # Backport This will backport the following commits from `main` to `8.19`: - [APM telemetry collection Otel agent distro diferentiation - issue 489 (#210775)](#210775) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Marco Gavazzoni","email":"138492709+marcogavaz@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-14T14:11:29Z","message":"APM telemetry collection Otel agent distro diferentiation - issue 489 (#210775)\n\n## Summary\r\n\r\nThis PRs follows the [closed PR\r\n](#208770) and Closes\r\nhttps://github.com/elastic/observability-bi/issues/489\r\n\r\nAs requested in [this comment\r\n](#186281 (comment)) and\r\ntracked by the issue https://github.com/elastic/kibana/issues/186281\r\nthis PR handles main changes introduced to address the request for\r\ncapturing open-ended OTel distro agent names with patter\r\n`opentelemetry/<LANGUAGE>/<DISTRO_NAME>`. These changes ensure that new\r\nagent names won’t be dropped in telemetry.\r\n\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [ ] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] If a plugin configuration key changed, check if it needs to be\r\nallowlisted in the cloud and added to the [docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n- [ ] This was checked for breaking HTTP API changes, and any breaking\r\nchanges have been approved by the breaking-change committee. The\r\n`release_note:breaking` label should be applied in these situations.\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [ ] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"1ee13cae705f2bf564a18c492bca4f9809245f7e","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","backport:skip","Team:obs-ux-infra_services","v9.1.0","v8.19.0"],"title":"APM telemetry collection Otel agent distro diferentiation - issue 489","number":210775,"url":"https://github.com/elastic/kibana/pull/210775","mergeCommit":{"message":"APM telemetry collection Otel agent distro diferentiation - issue 489 (#210775)\n\n## Summary\r\n\r\nThis PRs follows the [closed PR\r\n](#208770) and Closes\r\nhttps://github.com/elastic/observability-bi/issues/489\r\n\r\nAs requested in [this comment\r\n](#186281 (comment)) and\r\ntracked by the issue https://github.com/elastic/kibana/issues/186281\r\nthis PR handles main changes introduced to address the request for\r\ncapturing open-ended OTel distro agent names with patter\r\n`opentelemetry/<LANGUAGE>/<DISTRO_NAME>`. These changes ensure that new\r\nagent names won’t be dropped in telemetry.\r\n\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [ ] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] If a plugin configuration key changed, check if it needs to be\r\nallowlisted in the cloud and added to the [docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n- [ ] This was checked for breaking HTTP API changes, and any breaking\r\nchanges have been approved by the breaking-change committee. The\r\n`release_note:breaking` label should be applied in these situations.\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [ ] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"1ee13cae705f2bf564a18c492bca4f9809245f7e"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210775","number":210775,"mergeCommit":{"message":"APM telemetry collection Otel agent distro diferentiation - issue 489 (#210775)\n\n## Summary\r\n\r\nThis PRs follows the [closed PR\r\n](#208770) and Closes\r\nhttps://github.com/elastic/observability-bi/issues/489\r\n\r\nAs requested in [this comment\r\n](#186281 (comment)) and\r\ntracked by the issue https://github.com/elastic/kibana/issues/186281\r\nthis PR handles main changes introduced to address the request for\r\ncapturing open-ended OTel distro agent names with patter\r\n`opentelemetry/<LANGUAGE>/<DISTRO_NAME>`. These changes ensure that new\r\nagent names won’t be dropped in telemetry.\r\n\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [ ] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] If a plugin configuration key changed, check if it needs to be\r\nallowlisted in the cloud and added to the [docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n- [ ] This was checked for breaking HTTP API changes, and any breaking\r\nchanges have been approved by the breaking-change committee. The\r\n`release_note:breaking` label should be applied in these situations.\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [ ] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"1ee13cae705f2bf564a18c492bca4f9809245f7e"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Marco Gavazzoni <138492709+marcogavaz@users.noreply.github.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
As requested in this comment and tracked by the issue #186281 this PR handles main changes introduced to address the request for capturing open-ended OTel distro agent names with patter
opentelemetry/<LANGUAGE>/<DISTRO_NAME>. These changes ensure that new agent names won’t be dropped in telemetry.The tasks that were changed are
servicesandagentstask.Changes introduced in
servicestaskPreviously telemetry code enumerated OTel agents using a static array (OPEN_TELEMETRY_AGENT_NAMES) listing known agent names (like opentelemetry/java, opentelemetry/go, etc.), while now it starts with an empty object and dynamically add whatever agent names es query returns, so after retrieving the results, we let the data from the terms aggregator define which agent names exist, rather than forcing them to match any fixed array.
This is taken care mainly in
so for example if a new
agent.namelikeopentelemetry/java/elasticappears in the data, we automatically add it to aggregatedServicesChanges introduced in
agentstaskSimilarly telemetry code started with a large dictionary built from
OPEN_TELEMETRY_AGENT_NAMESand then for each prefixopentelemetrorotlpit aggregated subfields (framework, language, runtime versions) and tried to map them to the dictionary.While now after the prefix-based aggregator runs it look at the returned buckets. For each agentBucket (with a key
opentelemetry/<LANGUAGE>/<DISTRO_NAME>) an entry is dynamically created.This PR should be enough in order to be able to differentiate our distro from any other OTel distro as requested.
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesIdentify risks
Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.