We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
[object Object]
Describe the bug
When the agent is set up with nested global labels:
ELASTIC_APM_GLOBAL_LABELS=myObject.myKeyA=A,myObject.myKeyB.mySubKeyB=B
globalLabels
The resulting indexed transaction looks like labels.myObject: [object Object].
labels.myObject: [object Object]
In comparison, the Go agent indexes the transaction with labels.myObject_myKeyA: A and labels.myObject_myKeyB_mySubKeyB: B.
labels.myObject_myKeyA: A
labels.myObject_myKeyB_mySubKeyB: B
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I'd expect parity with what other agents do. The Go client replaces the dots with underscores to flatten the labels.
Also, the apm.setLabel and apm.addLabel APIs suggest that the dots are replaced with underscores (docs).
apm.setLabel
apm.addLabel
Environment (please complete the following information)
Not relevant
How are you starting the agent? (please tick one of the boxes)
agent.start()
require('elastic-apm-node').start(...)
elastic-apm-node/start
-r elastic-apm-node/start
Additional context
Agent config options:
As logged by the agent:
{"log.level":"info","@timestamp":"2024-06-20T16:37:50.649Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","agentVersion":"4.7.0","env":{"pid":37023,"proctitle":"/Users/afharo/.nvm/versions/node/v20.13.1/bin/node","os":"darwin 23.5.0","arch":"arm64","host":"ip-192-168-86-178.eu-central-1.compute.internal","timezone":"UTC+0200","runtime":"Node.js v20.13.1"},"config":{"active":{"source":"start","value":true},"breakdownMetrics":{"source":"start","value":true},"centralConfig":{"source":"start","value":false},"contextPropagationOnly":{"source":"start","value":true},"environment":{"source":"start","value":"development"},"globalLabels":{"source":"start","value":[["kibana_uuid","5b2de169-2785-441b-ae8c-186a1936b17d"],["git_rev","41883488bc4"],["myObject",{"keyA":"A","keyB":{"subKeyB":"B"}}]],"sourceValue":{"kibana_uuid":"5b2de169-2785-441b-ae8c-186a1936b17d","git_rev":"41883488bc4","myObject":{"keyA":"A","keyB":{"subKeyB":"B"}}}},"logLevel":{"source":"default","value":"info","commonName":"log_level"},"metricsInterval":{"source":"start","value":30,"sourceValue":"30s"},"serverUrl":{"source":"start","value":"https://kibana-cloud-apm.apm.us-east-1.aws.found.io/","commonName":"server_url"},"transactionSampleRate":{"source":"start","value":1,"commonName":"transaction_sample_rate"},"captureSpanStackTraces":{"source":"start","sourceValue":false},"secretToken":{"source":"start","value":"[REDACTED]","commonName":"secret_token"},"serviceName":{"source":"environment","value":"kibana","commonName":"service_name"},"serviceVersion":{"source":"start","value":"8.15.0","commonName":"service_version"}},"activationMethod":"require","message":"Elastic APM Node.js Agent v4.7.0"}
package.json dependencies:
package.json
"elastic-apm-node": "^4.7.0",
The text was updated successfully, but these errors were encountered:
For extra context, I noticed that changing the config to
- {"kibana_uuid":"5b2de169-2785-441b-ae8c-186a1936b17d","git_rev":"41883488bc4","myObject":{"keyA":"A","keyB":{"subKeyB":"B"}}}} + {"kibana_uuid":"5b2de169-2785-441b-ae8c-186a1936b17d","git_rev":"592aafcaba2","myObject.keyA":"A","myObject.keyB.subKeyB":"B"}}
Solves the issue (it automatically applies the underscore conversion)
Sorry, something went wrong.
No branches or pull requests
Describe the bug
When the agent is set up with nested global labels:
ELASTIC_APM_GLOBAL_LABELS=myObject.myKeyA=A,myObject.myKeyB.mySubKeyB=B
globalLabels
in the init config.The resulting indexed transaction looks like
labels.myObject: [object Object]
.In comparison, the Go agent indexes the transaction with
labels.myObject_myKeyA: A
andlabels.myObject_myKeyB_mySubKeyB: B
.To Reproduce
Steps to reproduce the behavior:
ELASTIC_APM_GLOBAL_LABELS=myObject.myKeyA=A,myObject.myKeyB.mySubKeyB=B
(or viaglobalLabels
in the init config.labels.myObject: [object Object]
Expected behavior
I'd expect parity with what other agents do. The Go client replaces the dots with underscores to flatten the labels.
Also, the
apm.setLabel
andapm.addLabel
APIs suggest that the dots are replaced with underscores (docs).Environment (please complete the following information)
Not relevant
How are you starting the agent? (please tick one of the boxes)
agent.start()
directly (e.g.require('elastic-apm-node').start(...)
)elastic-apm-node/start
from within the source code-r elastic-apm-node/start
Additional context
Agent config options:
Click to expand
As logged by the agent:
package.json
dependencies:Click to expand
The text was updated successfully, but these errors were encountered: