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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃殌 Feature]: Possibility of using opentelemetry-java-instrumentation #2138

Closed
amardeep2006 opened this issue Feb 18, 2024 · 8 comments
Closed

Comments

@amardeep2006
Copy link
Contributor

amardeep2006 commented Feb 18, 2024

Feature and motivation

This is just a discussion , I see that we are using following setup for Tracing:
Install coursier , use it to pull opentelemetry-exporter-otlp and opentelemetry-exporter-jaeger.

Recently I was exploring opentelemetry-java-instrumentation jar in one of my personal project and it felt a very non intrusive way of setting up the Tracing by autoinstrumentation. All I needed to do was download single jar from maven via curl, add it as Javagent under JAVA_OPTS and set few envt variables . It all felt very straight forward.

https://github.com/open-telemetry/opentelemetry-java-instrumentation

Since Jaeger has also deprecated Jaeger exporter in favour of OTLP so it should not be a big issue for existing Jaeger users. They have to migrate to OTLP protocol later or sooner.
Is this possible to do the same in selenium grid as well? Looking for pros and cons of doing this.
I am just Exploring the option/ feasibility as I am not very familiar with Selenium project's telemetry implementation.

Usage example

Standard approach for Tracing via OTLP protocol and Javaagent.

Copy link

@amardeep2006, 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!

@VietND96
Copy link
Member

In part of #2137, I updated the default protocol to otlp (endpoint port 4317 in Jaeger collector) instead of jaeger before, and via some testing, I can view trace logs on Jaeger UI

@VietND96
Copy link
Member

The changes were motivated from a recent change in this repo https://github.com/manoj9788/tracing-selenium-grid
Regarding coursier and pull dependencies, probably we will update later

@VietND96
Copy link
Member

Since in the upstream repo, tracing implementation with these dependencies https://github.com/SeleniumHQ/selenium/blob/trunk/java/maven_deps.bzl
In containerization, to export traces, otel exporter deps are needed, before it was both jaeger and otlp exporters. Now, via 74fdf72 - only OTLP is set as default and documented.
For Javaagent, I'm not sure. @diemol, do you have any comment?

@diemol
Copy link
Member

diemol commented Feb 19, 2024

I perceive that the Javaagent solution implies that there is no need to instrument the code in order to actually get visibility opentelemetry gives? Is it like that, @amardeep2006?

@amardeep2006
Copy link
Contributor Author

Yes that's what I was experimenting in one of my project. Javaagent does automatic byte code manipulation to generate telemetry data. I was also able to generate Traces and also relate span and traces with MDC in logs for correlation.
If we have done some manual instrumentation in upstream Selenium project then It will be interesting to see if Auto instrumentation respects that or not. If you think it's worth spending time, I can do a POC with selenium in a separate branch and see how both methods compare.

@amardeep2006
Copy link
Contributor Author

I gave it a thought again and feel not a high value story to invest time for now as Selenium has Otel Sdk/java api based implementation.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants