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

[🚀 Feature]: TracedCommandExecutor better span name #13905

Closed
felixscheinost opened this issue May 3, 2024 · 3 comments · Fixed by #14902
Closed

[🚀 Feature]: TracedCommandExecutor better span name #13905

felixscheinost opened this issue May 3, 2024 · 3 comments · Fixed by #14902
Labels
C-java help wanted Issues looking for contributions I-enhancement

Comments

@felixscheinost
Copy link

Feature and motivation

We are trying to use OTel tracing to find bottlenecks in the integration tests in our codebase.

We are looking for example for inefficient traversal off large DOM structures, which could be improved using better XPath queries.

Currently all spans generated by Selenium look the same, they all have "command" as the span name. (

try (Span commandSpan = tracer.getCurrentContext().createSpan("command")) {
) You have to click on them (in most GUIs) to view the command name in the span attributes which isn't very nice to quickly go through a big trace to find inefficiencies.

The guide says:

The span name concisely identifies the work represented by the Span, for example, an RPC method name, a function name, or the name of a subtask or stage within a larger computation. The span name SHOULD be the most general string that identifies a (statistically) interesting class of Spans, rather than individual Span instances while still being human-readable. That is, "get_user" is a reasonable name, while "get_user/314159", where "314159" is a user ID, is not a good name due to its high cardinality. Generality SHOULD be prioritized over human-readability.

My read is that if following this guide making the span name more special would be a good idea. E.g. "screenshot", "setCurrentWindowSize", "findElement", ...

Usage example

Make spans more readable. Instead of having:

  • command
  • command
  • command
  • command

I imagine

  • open
  • findElement
  • executeScript
  • screenshot

as an example.

Copy link

github-actions bot commented May 3, 2024

@felixscheinost, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@pujagani
Copy link
Contributor

pujagani commented May 6, 2024

Hello!
Thank you for details. I agree with your suggestion here and I am glad that will help you use the OTel bit in Selenium better. Would be open to sending a PR? We are more than happy to receive contributions on this front! :)

@pujagani pujagani added help wanted Issues looking for contributions C-java and removed needs-triaging labels May 6, 2024
Copy link

github-actions bot commented May 6, 2024

This issue is looking for contributors.

Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-java help wanted Issues looking for contributions I-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants