Skip to content
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

fix(apm): flatten globalLabels object #186579

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

afharo
Copy link
Member

@afharo afharo commented Jun 20, 2024

Summary

Related to elastic/apm-agent-nodejs#4096 (comment).

I noticed that the APM agents expect globalLabels to be key/value pairs. For this reason, when a label such as myObject.keyA: A or myObject.keyB.subKeyB: B is provided, the agents are configured as key: "myObject", value: { keyA: "A", keyB: { subKeyB: "B" } }, leading to APM reporting labels.myObject: [object Object].

This PR ensures the globalLabels object is flattened before providing it to the agents so that they apply their dot-to-underscore replacement in the key as declared in the docs.

Checklist

For maintainers

@afharo afharo added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting apm:instrumentation labels Jun 20, 2024
@afharo afharo self-assigned this Jun 20, 2024
@afharo
Copy link
Member Author

afharo commented Jun 20, 2024

/ci

@afharo afharo marked this pull request as ready for review June 20, 2024 22:11
@afharo afharo requested review from vigneshshanmugam and a team as code owners June 20, 2024 22:11
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

Copy link
Member

@vigneshshanmugam vigneshshanmugam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Jun 20, 2024
@afharo afharo enabled auto-merge (squash) June 21, 2024 07:25
@kibana-ci
Copy link
Collaborator

kibana-ci commented Jun 21, 2024

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #9 / GlobalDataTagsTable should add new tags

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @afharo

@afharo afharo merged commit aaf8914 into elastic:main Jun 21, 2024
25 checks passed
@afharo afharo deleted the flatten-apm.globalLabels branch June 21, 2024 08:54
bhapas pushed a commit to bhapas/kibana that referenced this pull request Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:instrumentation backport:skip This commit does not require backporting ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants