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

elasticsearch instrumentation creates too many span names, with unique document IDs. #704

Closed
remram44 opened this issue Oct 1, 2021 · 2 comments · Fixed by #705
Closed
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed instrumentation

Comments

@remram44
Copy link
Contributor

remram44 commented Oct 1, 2021

Describe your environment
Using opentelemetry-instrumentation-elasticsearch 0.24b0 with elasticsearch 7.14.1

Steps to reproduce
Perform some index() and/or delete() calls with id parameter set

What is the expected behavior?
The number of span names created is reasonable and finite

What is the actual behavior?
An unbounded number of span names get created, containing the unique document names. This makes it hard to search through operations, for example in Jaeger:

screenshot

The datamart.test.xxxx parts are the Elasticsearch document IDs.

Additional context
I have a patch for this incoming.

@remram44 remram44 added the bug Something isn't working label Oct 1, 2021
@owais
Copy link
Contributor

owais commented Oct 1, 2021

According to the Otel spec, the operation name should be <db.operation> <db.name>.<db.sql.table>. Looks like we are capturing document names in the span op name which is more analogous to a row than a table. We should update it to <db.operation> <db.name>.<index.name> and never capture document name in the span operation name.

PRs welcome :)

@owais owais added good first issue Good for newcomers help wanted Extra attention is needed instrumentation labels Oct 1, 2021
@remram44
Copy link
Contributor Author

remram44 commented Oct 1, 2021

The current instrumentation is way less sophisticated, basically using the request URL as the span name. I only dealt with the specific issue of document IDs in #705, changing it to the format you describe is a significant effort (probably would have to stop instrumenting perform_request() and instrument single methods instead).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed instrumentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants