avioconsulting / mule-opentelemetry-module

Mule Extension to generate OpenTelemetry traces and metrics
https://avioconsulting.github.io/mule-opentelemetry-module/
BSD 2-Clause "Simplified" License
26 stars 8 forks source link

java.lang.NoSuchMethodError: io.opentelemetry.sdk.trace.data.SpanData.getInstrumentationScopeInfo #50

Closed Maikels closed 2 years ago

Maikels commented 2 years ago

Hello,

When upgrading the opentelemetry version to 1.18.0 to support OtlpHttpSpanExporter 'setClientTls' combined with 'setTrustedCertificates'

I keep getting following in mule app:

org.mule.runtime.core.internal.context.notification.Policy: NotificationListener MulePipelineMessageNotificationListener@4fa4d75f was unable to fire notification PipelineMessageNotification{action=pipeline process complete, resourceId=testFlow, serverId=BEDGBWN10I20402..test, timestamp=1663328140557} due to an exception: java.lang.BootstrapMethodError: java.lang.NoSuchMethodError: io.opentelemetry.sdk.trace.data.SpanData.getInstrumentationScopeInfo()Lio/opentelemetry/sdk/common/InstrumentationScopeInfo;.

While remote debugging I saw this happening because of this method (in ResourceSpansMarshaler - called when trying to end a span): private static Map<Resource, Map<InstrumentationScopeInfo, List>> groupByResourceAndScope(Collection spanDataList) { return MarshalerUtil.groupByResourceAndScope( spanDataList, // TODO(anuraaga): Replace with an internal SdkData type of interface that exposes these // two. SpanData::getResource, SpanData::getInstrumentationScopeInfo, SpanMarshaler::create); }

In particular 'getInstrumentationScopeInfo'

I'm not exactly sure why this is throwing that error as all dependencies are on 1.18.0

manikmagar commented 2 years ago

Thank you @Maikels for raising this. Just curious, how are you upgrading the dependency version - in this module or in your mule application?

Maikels commented 2 years ago

@manikmagar Hi!

I did clone this repo local and updated the otel version in the project, I need the setTrustedCertificates function and it is only available since 1.13.0. Then just installed it locally and used the updated version in my mule project

manikmagar commented 2 years ago

@Maikels We have just released v1.1.0 that includes upgrading OTEL to 1.19.0, along with other features. You shouldn't need to modify module for setting TLS and can just set the appropriate environment variables on your runtime for it. See SDK Variables here. If it doesn't work, please provide more details on how are you configuring it in your mule app and system level. Hope this helps.

Maikels commented 2 years ago

Thank you for getting back to me @manikmagar ! Exactly what I needed, thanks!