-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
update APM nodejs agent to a version usable without APM-server #102624
Comments
Pinging @elastic/kibana-core (Team:Core) |
elastic/apm-agent-nodejs#2101 has been included in |
I played around a bit with using the APM agent for storing In the current task, I will update the APM agent version anyway as it's a prerequisite for adding tracing information to the Kibana logs #102699 In a follow-up PR, I can add client.on('request', (e, event) => {
agent.setCustomContext({ kbnContextReq: 'kbnContextReq' });
agent.setLabel('kbnContextReq', 'kbnContextReq');
});
client.on('response', (error, event) => {
agent.setCustomContext({ kbnContextRes: 'kbnContextRes' });
agent.setLabel('kbnContextRes', 'kbnContextRes');
}); But I don't see them in APM UI. Should I configure anything else? |
If we are okay to keep the current |
First, I'm worried there is some miscommunication on terminology. In APM terminology for a single incoming request to some service (e.g. the Kibana API), there is a single "transaction". Under that transaction there is a hierarchy of zero or more "spans" for interesting events -- either manually added via The screenshot above is a fly out for a span.
At runtime, when that
I assume you mean the Elasticsearch request span. The Perhaps what you want is to set data on the span via: client.on('request', function (err, event) {
// apm.setCustomContext({kbnExecutionContext: getExecutionContext()})
apm.currentSpan.setLabel('kbnExecutionContext', JSON.stringify(getExecutionContext()))
} Note that labels are indexed, as opposed to custom context not being indexed. That is probably fine, though. Also labels can only be string, number, or boolean, so you'd have to stringify the KibanaExecutionContext somehow -- perhaps Does that answer your question? I think I am sometimes getting mixed up between (a) the effort to track execution context without APM UI and (b) adding info to APM UI about this tracked execution context. |
My bad, you are absolutely right. I shouldn't have hijacked the initial topic.
This is a potential follow-up task and shouldn't be considered as part of the current issue. |
Kibana is going to use the APM nodejs agent for log correlation. For this, we need a mode when the APM nodejs agent can be used without sending data to the APM server.
Blocked by elastic/apm-agent-nodejs#2101 Update to a version containing the enhancement.
After the agent version is updated, investigate whether we can (and should) use APM (see setCustomContext) for context propagation instead of relying on a custom AsyncLocalStorage. With this API, customContext will be available in APM UI as well.
The text was updated successfully, but these errors were encountered: