Skip to content

Commit

Permalink
Remove all references to Jaeger (SteeltoeOSS#1385)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimHess authored Oct 18, 2024
1 parent 63ab29c commit 33ea28f
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="$(OpenTelemetryVersion)" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="$(OpenTelemetryVersion)" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="$(OpenTelemetryVersion)" PrivateAssets="all" />
<PackageReference Include="OpenTelemetry.Exporter.Jaeger" Version="$(OpenTelemetryExporterJaegerVersion)" PrivateAssets="all" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="$(OpenTelemetryVersion)" PrivateAssets="all" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,13 @@ public static IServiceCollection AddDistributedTracing(this IServiceCollection s
services.TryAddEnumerable(ServiceDescriptor.Singleton<IDynamicMessageProcessor, TracingLogProcessor>());

bool exportToZipkin = AssemblyLoader.IsAssemblyLoaded("OpenTelemetry.Exporter.Zipkin");
bool exportToJaeger = AssemblyLoader.IsAssemblyLoaded("OpenTelemetry.Exporter.Jaeger");
bool exportToOpenTelemetryProtocol = AssemblyLoader.IsAssemblyLoaded("OpenTelemetry.Exporter.OpenTelemetryProtocol");

if (exportToZipkin)
{
ConfigureZipkinOptions(services);
}

if (exportToJaeger)
{
ConfigureJaegerOptions(services);
}

if (exportToOpenTelemetryProtocol)
{
ConfigureOpenTelemetryProtocolOptions(services);
Expand All @@ -93,11 +87,6 @@ public static IServiceCollection AddDistributedTracing(this IServiceCollection s
AddZipkinExporter(tracerProviderBuilder);
}

if (exportToJaeger)
{
AddJaegerExporter(tracerProviderBuilder);
}

if (exportToOpenTelemetryProtocol)
{
AddOpenTelemetryProtocolExporter(tracerProviderBuilder);
Expand Down Expand Up @@ -128,8 +117,7 @@ public static IServiceCollection AddDistributedTracing(this IServiceCollection s
ILogger logger = serviceProvider.GetRequiredService<ILoggerFactory>()
.CreateLogger($"{typeof(TracingBaseServiceCollectionExtensions).Namespace}.Setup");

logger.LogTrace("Found Zipkin exporter: {ExportToZipkin}. Found Jaeger exporter: {ExportToJaeger}. Found OTLP exporter: {ExportToOtlp}.",
exportToZipkin, exportToJaeger, exportToOpenTelemetryProtocol);
logger.LogTrace("Found Zipkin exporter: {ExportToZipkin}. Found OTLP exporter: {ExportToOtlp}.", exportToZipkin, exportToOpenTelemetryProtocol);

tracerProviderBuilder.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(tracingOptions.Name!));

Expand Down Expand Up @@ -180,27 +168,6 @@ private static void AddZipkinExporter(TracerProviderBuilder builder)
builder.AddZipkinExporter();
}

private static void ConfigureJaegerOptions(IServiceCollection services)
{
services.AddOptions<JaegerExporterOptions>().PostConfigure<IOptionsMonitor<TracingOptions>>((jaegerExporterOptions, tracingOptionsMonitor) =>
{
TracingOptions tracingOptions = tracingOptionsMonitor.CurrentValue;

jaegerExporterOptions.MaxPayloadSizeInBytes = tracingOptions.MaxPayloadSizeInBytes;

if (tracingOptions.ExporterEndpoint != null)
{
jaegerExporterOptions.AgentHost = tracingOptions.ExporterEndpoint.Host;
jaegerExporterOptions.AgentPort = tracingOptions.ExporterEndpoint.Port;
}
});
}

private static void AddJaegerExporter(TracerProviderBuilder builder)
{
builder.AddJaegerExporter();
}

private static void ConfigureOpenTelemetryProtocolOptions(IServiceCollection services)
{
services.AddOptions<OtlpExporterOptions>().PostConfigure<IOptionsMonitor<TracingOptions>>((otlpExporterOptions, tracingOptionsMonitor) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

<ItemGroup>
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="$(OpenTelemetryVersion)" />
<PackageReference Include="OpenTelemetry.Exporter.Jaeger" Version="$(OpenTelemetryExporterJaegerVersion)" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="$(OpenTelemetryVersion)" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ public async Task AddDistributedTracing_WiresIncludedExporters()

var zipkinOptions = serviceProvider.GetRequiredService<IOptions<ZipkinExporterOptions>>();
Assert.NotNull(zipkinOptions.Value.Endpoint);

var jaegerOptions = serviceProvider.GetRequiredService<IOptions<JaegerExporterOptions>>();
Assert.NotNull(jaegerOptions.Value.Endpoint);
}

[Fact]
Expand Down
1 change: 0 additions & 1 deletion versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
8.0.*
</FoundationalVersion>
<MicrosoftIdentityModelVersion>7.6.*</MicrosoftIdentityModelVersion>
<OpenTelemetryExporterJaegerVersion>1.6.*-*</OpenTelemetryExporterJaegerVersion>
<OpenTelemetryExporterPrometheusVersion>1.9.*-*</OpenTelemetryExporterPrometheusVersion>
<OpenTelemetryVersion>1.9.*</OpenTelemetryVersion>
<SerilogVersion>8.0.*</SerilogVersion>
Expand Down

0 comments on commit 33ea28f

Please sign in to comment.