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

Add more attributes for elasticsearch rest client [5.10, 7.16). #13338

Open
h0cheung opened this issue Feb 18, 2025 · 0 comments
Open

Add more attributes for elasticsearch rest client [5.10, 7.16). #13338

h0cheung opened this issue Feb 18, 2025 · 0 comments
Labels
enhancement New feature or request needs triage New issue that requires triage

Comments

@h0cheung
Copy link

h0cheung commented Feb 18, 2025

Is your feature request related to a problem? Please describe.

For rest client in elasticsearch [5.0, 7.16), very poor informations are extracted in the spans:

  • name: "POST"
  • db.system: "elasticsearch"
  • http.method
  • http.url
  • server.address
  • server.port

Many useful attributes, such as db.operation.name, db.collection.name, db.namespace, are missing.

Describe the solution you'd like

We can instrument the rest high level client. By getting the high level ActionRequest, we can get db.operation.name and db.collection.name (indices) easily.

There is an implementation in the Skywalking javaagent, which seems good: https://github.com/apache/skywalking-java/tree/main/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin

Describe alternatives you've considered

Maybe another way is trying to parse the URLs. Once a URL is successfully parsed, we can get db.operation.name and db.collection.name easily.

Additional context

I didn't found a good way to get the db.namespace, which should be the name of Elasticsearch cluster.

@h0cheung h0cheung added enhancement New feature or request needs triage New issue that requires triage labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New issue that requires triage
Projects
None yet
Development

No branches or pull requests

1 participant