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

[🐛 Bug]: Tracing seems to be affected with the Selenium version org.seleniumhq.selenium:selenium-java:4.24.0 #14519

Closed
rishabhjain-qait opened this issue Sep 19, 2024 · 9 comments

Comments

@rishabhjain-qait
Copy link

rishabhjain-qait commented Sep 19, 2024

What happened?

I do have tracing support present in my framework,
and using below libraries for same
// For Jaeger Tracing
exporter_otlp : 'io.opentelemetry:opentelemetry-exporter-otlp:1.42.1',
exporter_jaeger : 'io.opentelemetry:opentelemetry-exporter-jaeger:1.34.1',

with java11 and selenium 4.23
this was working fine and i was able to push traces to selenium jaeger, was able to view them on the jaegerUI


Now I have recently upgraded my automation repo from java11 to java17 and have also upgrade from selenium 4.23 to selenium 4.24,
But with this upgrade i have started observing issues in tracing support,

it shows below exception
java.util.ServiceConfigurationError: io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider: Provider io.opentelemetry.exporter.logging.otlp.internal.LoggingSpanExporterProvider not found
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1219)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1228)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393)
at io.opentelemetry.sdk.autoconfigure.internal.SpiHelper.load(SpiHelper.java:152)
at io.opentelemetry.sdk.autoconfigure.internal.SpiHelper.loadConfigurable(SpiHelper.java:70)
at io.opentelemetry.sdk.autoconfigure.SpanExporterConfiguration.spanExporterSpiManager(SpanExporterConfiguration.java:82)
at io.opentelemetry.sdk.autoconfigure.SpanExporterConfiguration.configureSpanExporters(SpanExporterConfiguration.java:64)
at io.opentelemetry.sdk.autoconfigure.TracerProviderConfiguration.configureTracerProvider(TracerProviderConfiguration.java:58)
at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.build(AutoConfiguredOpenTelemetrySdkBuilder.java:465)
at org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer.createTracer(OpenTelemetryTracer.java:85)
at org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer.getInstance(OpenTelemetryTracer.java:59)
at org.openqa.selenium.remote.RemoteWebDriver.createExecutor(RemoteWebDriver.java:197)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:153)
at com.spr.core.ui.browser.Browser.createDriverWithTimeout(Browser.java:120)
at com.spr.core.ui.browser.Browser.getRemoteDriver(Browser.java:40)
at com.spr.core.ui.WebDriverThread.setExecutionStyle(WebDriverThread.java:152)
at com.spr.core.ui.WebDriverThread.getDriver(WebDriverThread.java:65)
at com.spr.core.ui.BrowserInit.lambda$initDriver$0(BrowserInit.java:54)
at java.base/java.lang.ThreadLocal$SuppliedThreadLocal.initialValue(ThreadLocal.java:305)
at java.base/java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:195)
at java.base/java.lang.ThreadLocal.get(ThreadLocal.java:172)
at com.spr.core.ui.BrowserInit.getDriver(BrowserInit.java:91)
at com.spr.core.ui.listeners.ReportingEventListener.afterInvocation(ReportingEventListener.java:123)
at org.testng.internal.invokers.InvokedMethodListenerInvoker.invokeListener(InvokedMethodListenerInvoker.java:59)
at org.testng.internal.invokers.BaseInvoker.runInvokedMethodListeners(BaseInvoker.java:80)
at org.testng.internal.invokers.TestInvoker.invokeListenersForSkippedTestResult(TestInvoker.java:498)
at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:599)
at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:227)
at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:957)
at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200)
at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:842)

    **I have tried using latest dependencies for both of these but it did not work,** 
    opentelemetry-exporter-otlp
    opentelemetry-exporter-jaeger

    **I have also tried adding below flag as suggested** but this also did not work
    -Dotel.java.global-autoconfigure.enabled=true

Now when i am adding above flag

I am seeing some different exception, which is

java.util.ServiceConfigurationError: io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider: Provider io.opentelemetry.exporter.logging.otlp.internal.LoggingSpanExporterProvider not found at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1219) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1228) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273) at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309) at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393) at io.opentelemetry.sdk.autoconfigure.internal.SpiHelper.load(SpiHelper.java:152) at io.opentelemetry.sdk.autoconfigure.internal.SpiHelper.loadConfigurable(SpiHelper.java:70) at io.opentelemetry.sdk.autoconfigure.SpanExporterConfiguration.spanExporterSpiManager(SpanExporterConfiguration.java:82) at io.opentelemetry.sdk.autoconfigure.SpanExporterConfiguration.configureSpanExporters(SpanExporterConfiguration.java:64) at io.opentelemetry.sdk.autoconfigure.TracerProviderConfiguration.configureTracerProvider(TracerProviderConfiguration.java:58) at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.build(AutoConfiguredOpenTelemetrySdkBuilder.java:465) at org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer.createTracer(OpenTelemetryTracer.java:85) at org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer.getInstance(OpenTelemetryTracer.java:59) at org.openqa.selenium.remote.RemoteWebDriver.createExecutor(RemoteWebDriver.java:197) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:153) at com.spr.core.ui.browser.Browser.createDriverWithTimeout(Browser.java:120) at com.spr.core.ui.browser.Browser.getRemoteDriver(Browser.java:40) at com.spr.core.ui.WebDriverThread.setExecutionStyle(WebDriverThread.java:152) at com.spr.core.ui.WebDriverThread.getDriver(WebDriverThread.java:65) at com.spr.core.ui.BrowserInit.lambda$initDriver$0(BrowserInit.java:54) at java.base/java.lang.ThreadLocal$SuppliedThreadLocal.initialValue(ThreadLocal.java:305) at java.base/java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:195) at java.base/java.lang.ThreadLocal.get(ThreadLocal.java:172) at com.spr.core.ui.BrowserInit.getDriver(BrowserInit.java:91) at com.spr.core.ui.BrowserInit.checkSession(BrowserInit.java:72) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139) at org.testng.internal.invokers.MethodInvocationHelper$2.runConfigurationMethod(MethodInvocationHelper.java:453) at com.spr.core.ui.BrowserInit.run(BrowserInit.java:324) at org.testng.internal.invokers.MethodInvocationHelper.invokeConfigurable(MethodInvocationHelper.java:467) at org.testng.internal.invokers.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:387) at org.testng.internal.invokers.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:325) at org.testng.internal.invokers.TestInvoker.runConfigMethods(TestInvoker.java:810) at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:577) at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:227) at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50) at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:957) at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200) at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148) at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:842)

How can we reproduce the issue?

Use java 17 and sel version 4.24, 

and 

below dependencies for traces 
        exporter_otlp           : 'io.opentelemetry:opentelemetry-exporter-otlp:1.42.1',
        exporter_jaeger         : 'io.opentelemetry:opentelemetry-exporter-jaeger:1.34.1',


try exporting traces from your tests to jaeger.

Relevant log output

java.util.ServiceConfigurationError: io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider: Provider io.opentelemetry.exporter.logging.otlp.internal.LoggingSpanExporterProvider not found
        at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593)
        at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1219)
        at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1228)
        at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273)
        at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309)
        at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393)
        at io.opentelemetry.sdk.autoconfigure.internal.SpiHelper.load(SpiHelper.java:152)
        at io.opentelemetry.sdk.autoconfigure.internal.SpiHelper.loadConfigurable(SpiHelper.java:70)
        at io.opentelemetry.sdk.autoconfigure.SpanExporterConfiguration.spanExporterSpiManager(SpanExporterConfiguration.java:82)
        at io.opentelemetry.sdk.autoconfigure.SpanExporterConfiguration.configureSpanExporters(SpanExporterConfiguration.java:64)
        at io.opentelemetry.sdk.autoconfigure.TracerProviderConfiguration.configureTracerProvider(TracerProviderConfiguration.java:58)
        at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.build(AutoConfiguredOpenTelemetrySdkBuilder.java:465)
        at org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer.createTracer(OpenTelemetryTracer.java:85)
        at org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer.getInstance(OpenTelemetryTracer.java:59)
        at org.openqa.selenium.remote.RemoteWebDriver.createExecutor(RemoteWebDriver.java:197)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:153)
        at com.spr.core.ui.browser.Browser.createDriverWithTimeout(Browser.java:120)
        at com.spr.core.ui.browser.Browser.getRemoteDriver(Browser.java:40)
        at com.spr.core.ui.WebDriverThread.setExecutionStyle(WebDriverThread.java:152)
        at com.spr.core.ui.WebDriverThread.getDriver(WebDriverThread.java:65)
        at com.spr.core.ui.BrowserInit.lambda$initDriver$0(BrowserInit.java:54)
        at java.base/java.lang.ThreadLocal$SuppliedThreadLocal.initialValue(ThreadLocal.java:305)
        at java.base/java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:195)
        at java.base/java.lang.ThreadLocal.get(ThreadLocal.java:172)
        at com.spr.core.ui.BrowserInit.getDriver(BrowserInit.java:91)
        at com.spr.core.ui.listeners.ReportingEventListener.afterInvocation(ReportingEventListener.java:123)
        at org.testng.internal.invokers.InvokedMethodListenerInvoker.invokeListener(InvokedMethodListenerInvoker.java:59)
        at org.testng.internal.invokers.BaseInvoker.runInvokedMethodListeners(BaseInvoker.java:80)
        at org.testng.internal.invokers.TestInvoker.invokeListenersForSkippedTestResult(TestInvoker.java:498)
        at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:599)
        at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:227)
        at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
        at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:957)
        at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200)
        at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
        at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:842)

Operating System

macOS

Selenium version

4.24

What are the browser(s) and version(s) where you see this issue?

Chrome

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver

Are you using Selenium Grid?

4.23.0

Copy link

@rishabhjain-qait, 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!

@rishabhjain-qait
Copy link
Author

cc: @rookieInTraining

@rishabhjain-qait
Copy link
Author

c8676ef#diff-0cf141b01e48a733ec9037c51d8e610e7727d05a6b79aa0176def7c3a0fc311bR142

i have also came across this recent change,
please help in understanding what is changed here that is affecting this.

@rishabhjain-qait
Copy link
Author

@diemol
Can you please have a look here once

@diemol
Copy link
Member

diemol commented Sep 19, 2024

The change does not affect tracing, it simply offers a way to disable it.

@rishabhjain-qait
Copy link
Author

rishabhjain-qait commented Sep 20, 2024

okay,
what about the stacktraces that i have started observing here,
anything on this please ?

cc: @pujagani

@joerg1985
Copy link
Member

@rishabhjain-qait i think the jaeger exporter is outdated, so this might be related to incompatible versions in the transitive dependencies
https://opentelemetry.io/blog/2023/jaeger-exporter-collector-migration/

@rishabhjain-qait
Copy link
Author

Thanks @joerg1985, this helped

System.setProperty("otel.traces.exporter", "jaeger");
io.opentelemetry:opentelemetry-exporter-jaeger:1.34.1
I was using above

System.setProperty("otel.traces.exporter", "otlp");
i have used io.opentelemetry:opentelemetry-exporter-logging-otlp:1.42.1
now i have moved to above

and it seems to have worked fine without any issues

Copy link

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

@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 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

4 participants
@diemol @joerg1985 @rishabhjain-qait and others