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

[WIP] Use OTLP exporter by default #324

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion dev/envvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ fi
export OTEL_DOTNET_TRACER_HOME="${CURDIR}/bin/tracer-home"
export OTEL_INTEGRATIONS="${CURDIR}/bin/tracer-home/integrations.json"
export OTEL_TRACE_DEBUG="1"
export OTEL_EXPORTER="zipkin"
export OTEL_DUMP_ILREWRITE_ENABLED="0"
export OTEL_CLR_ENABLE_INLINING="1"
export OTEL_PROFILER_EXCLUDE_PROCESSES="dotnet.exe,dotnet"
2 changes: 1 addition & 1 deletion docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The exporter is used to output the telemetry.

| Environment variable | Description | Default |
|-|-|-|
| `OTEL_EXPORTER` | The exporter to be used. The Tracer uses it to encode and dispatch traces. Available values are: `zipkin`, `jeager`, `otlp`. | |
| `OTEL_EXPORTER` | The exporter to be used. The Tracer uses it to encode and dispatch traces. Available values are: `zipkin`, `jeager`, `otlp`. | `otlp` |
| `OTEL_EXPORTER_JAEGER_AGENT_HOST` | Hostname for the Jaeger agent. | `localhost` |
| `OTEL_EXPORTER_JAEGER_AGENT_PORT` | Port for the Jaeger agent. | `6831` |
| `OTEL_EXPORTER_OTLP_ENDPOINT` | Target endpoint for OTLP exporter. More details [here](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md). | `http://localhost:4318` |
Expand Down
2 changes: 2 additions & 0 deletions samples/ConsoleApp/ConsoleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.0.3" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="6.0.0" />
<PackageReference Include="OpenTracing" Version="0.12.1" />

<!-- Hack to fix SDK dependencies -->
Expand Down
4 changes: 2 additions & 2 deletions samples/ConsoleApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ private static async Task RunAsync()
activity?.SetTag("foo", "bar");

await HttpGet("https://www.example.com/default-handler");
await HttpGet("http://127.0.0.1:8080/api/mongo");
await HttpGet("http://127.0.0.1:8080/api/redis");
// await HttpGet("http://127.0.0.1:8080/api/mongo");
// await HttpGet("http://127.0.0.1:8080/api/redis");
}

var request = new HttpRequestMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ConfigurationKeys
/// <summary>
/// Configuration key for the exporter to be used. The Tracer uses it to encode and
/// dispatch traces.
/// Default is <c>"Zipkin"</c>.
/// Default is <c>"otlp"</c>.
/// </summary>
public const string Exporter = "OTEL_EXPORTER";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ private static TracerProviderBuilder SetExporter(this TracerProviderBuilder buil
// See: https://docs.microsoft.com/aspnet/core/grpc/troubleshoot#call-insecure-grpc-services-with-net-core-client
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
#endif
builder.AddOtlpExporter(options =>
{
options.ExportProcessorType = ExportProcessorType.Simple; // workaround for https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/issues/290
});
builder.AddOtlpExporter();
break;
case "":
case null:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private Settings(IConfigurationSource source)
throw new ArgumentNullException(nameof(source));
}

Exporter = source.GetString(ConfigurationKeys.Exporter);
Exporter = source.GetString(ConfigurationKeys.Exporter) ?? "otlp";
LoadTracerAtStartup = source.GetBool(ConfigurationKeys.LoadTracerAtStartup) ?? true;
ConsoleExporterEnabled = source.GetBool(ConfigurationKeys.ConsoleExporterEnabled) ?? true;

Expand Down