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

Integrate ES with APM #84631

Closed
wants to merge 52 commits into from
Closed

Integrate ES with APM #84631

wants to merge 52 commits into from

Conversation

pugnascotia
Copy link
Contributor

This PR merges in the proof-of-concept work for adding tracing to Elasticsearch. It uses the OpenTelemetry library, with the expectation that the traces will be sent to Elastic's APM integration.

Much of the APM-specific code is in the apm-integration plugin. Most of the rest of the changes are concerned with expression some activity in ES more clearly in terms of tasks, since this work maps tasks to spans.

tlrx and others added 24 commits November 15, 2021 08:50
This pull request adds support for HTPP/gRPC with the OpenTelemetry SDK
in the `apm-integration` plugin. It adds the required security
permissions to the plugin to make it work - we should try to reduce this
list one day. The plumbing to pass Elastic's Cloud APM server
credentials is not fully there yet but the current `ApmIT` test can be
executed with `-Dtests.apm.endpoint=https://... -Dtests.apm.token=ABC`
and traces should be sent to Elastic APM. _Works on my machine™_
Task now implements the Traceable interface. This allows other traceable
entities to be developed.
…80758)

Pass a task's span context via the ThreadContext to parent nested tasks.
Adds a test case that creates and populates a couple of multi-shard
indices and executes a search against them.
* Can be turned off with xpack.security.authz.tracing: false
* AuthZ is tied to relevant task by traceparent (it however does not
  cover the first authZ)
* x-opaque-id is auto configured at rest layer if not already exists.
  This helps chain all relevant actions together.
* ApmIT now has security enabled.
This commit adds a dynamic cluster setting called `xpack.apm.tracing.names.include`
which allows the user to filter on the names of the transactions for which
tracing is enabled.
@pugnascotia pugnascotia added >feature WIP :Delivery/Tooling Developer tooliing and automation v8.2.0 labels Mar 3, 2022
Turns out that if you disabled authz tracing, it prevented tracing
headers being sent to other nodes because the authz service still
started a new trace context, without starting a new span.

Also require callers of `TaskManager#register` to handle their own trace
contexts. Callers of TaskManager#registerAndExecute` don't have to do
this, which is most of the codebase. This is to avoid trace header
pollution in the thread context.
@pugnascotia pugnascotia changed the title WIP: Initial APM integration Integrate ES with APM Jun 15, 2022
@pugnascotia pugnascotia mentioned this pull request Jun 15, 2022
2 tasks
@pugnascotia
Copy link
Contributor Author

Closing in favour of #87696.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloud-deploy Publish cloud docker image for Cloud-First-Testing :Delivery/Tooling Developer tooliing and automation >feature v8.4.0 WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants