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

Use APM RUM agent to pass Kibana execution context #102615

Closed
mshustov opened this issue Jun 18, 2021 · 8 comments
Closed

Use APM RUM agent to pass Kibana execution context #102615

mshustov opened this issue Jun 18, 2021 · 8 comments
Labels
enhancement New value added to drive a business result Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@mshustov
Copy link
Contributor

mshustov commented Jun 18, 2021

In #101587, Kibana is going to use a custom kbn-context header to pass execution context during a request from the Kibana browser app to the Kibana server.
With elastic/apm-agent-rum-js#1040, we should be able to remove the custom header and switch to APM RUM agent API that will allow associating context metadata with an APM transaction. APM RUM agent will take care of serialization and passing context via proper tracing headers.

@mshustov mshustov added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc enhancement New value added to drive a business result labels Jun 18, 2021
@elasticmachine
Copy link
Contributor

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

@felixbarny
Copy link
Member

APM RUM agent will take care of serialization and passing context via proper tracing headers.

This will only work once our agents implement support for baggage. This requires a new API to add baggage, as well as header propagation.

@mshustov
Copy link
Contributor Author

mshustov commented Jun 18, 2021

This will only work once our agents implement support for baggage.

@felixbarny Won't APM RUM agent propagate a bound context?
I agree that baggage header has the right semantic, we can wait for elastic/apm-agent-nodejs#2102 then. Btw, shouldn't the APM RUM agent open a similar issue to support the baggage header effort?

@felixbarny
Copy link
Member

Won't APM RUM agent propagate a bound context?

No, our agents only propagate the traceparent header which contains correlation IDs. It looks like this:

traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01
(_________)  () (______________________________) (______________) ()
     v       v                 v                        v         v
  Name    Version           Trace-Id                Parent-Id     Flags

All the labels are not propagated to downstream services. Instead, each agent directly sends it's spans to APM Server. Using the trace-id it's then possible to correlate the different events.

@mshustov
Copy link
Contributor Author

mshustov commented Jun 18, 2021

No, our agents only propagate the traceparent header which contains correlation IDs

ok, I wrongly assumed our agent propagates the standard tracestate header as well. Which can be used to pass custom data.

@felixbarny
Copy link
Member

Yep, we transmit that, too. But that header is not meant for user-definable key/value pairs. We use that internally to propagate the sampling rate so that we can upscale metrics.

@lizozom
Copy link
Contributor

lizozom commented Mar 3, 2022

@mshustov isn't this resolved by #124996 ?

@lizozom
Copy link
Contributor

lizozom commented Mar 6, 2022

I think this is made obsolete by #102629 and other recent work.
Closing for now, please reopen if I got it wrong.

@lizozom lizozom closed this as completed Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

4 participants