Fix OTLP exporter configuration

This commit is contained in:
Simon Larsen
2023-12-31 15:09:29 +00:00
parent 1b8a5f8ddb
commit 8b8caed4ac
8 changed files with 17 additions and 6 deletions

View File

@@ -28,7 +28,7 @@ builder.Logging.AddOpenTelemetry(logging =>
.AddConsoleExporter()
.AddOtlpExporter(opt =>
{
// opt.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.HttpProtobuf;
opt.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.HttpProtobuf;
System.Console.WriteLine($"OTLP Exporter is using {opt.Protocol} protocol and endpoint {opt.Endpoint}");
});
});
@@ -42,7 +42,7 @@ builder.Services.AddOpenTelemetry()
.AddConsoleExporter()
.AddOtlpExporter(opt =>
{
// opt.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.HttpProtobuf;
opt.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.HttpProtobuf;
System.Console.WriteLine($"OTLP Exporter is using {opt.Protocol} protocol and endpoint {opt.Endpoint}");
}));
@@ -64,7 +64,7 @@ builder.Services.AddOpenTelemetry()
})
.AddOtlpExporter(opt =>
{
// opt.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.HttpProtobuf;
opt.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.HttpProtobuf;
System.Console.WriteLine($"OTLP Exporter is using {opt.Protocol} protocol and endpoint {opt.Endpoint}");
}));

View File

@@ -8,3 +8,9 @@ Please use
export OTEL_EXPORTER_OTLP_HEADERS="x-oneuptime-service-token=9c8806e0-a4aa-11ee-be95-010d5967b068" && export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost" && dotnet run --urls=http://localhost:7856/
```
### Run on test server
```bash
export OTEL_EXPORTER_OTLP_HEADERS="x-oneuptime-service-token=41505e10-a7d6-11ee-b9c3-4f66c767c922" && export OTEL_EXPORTER_OTLP_ENDPOINT="https://test-otlp.oneuptime.com" && dotnet run --urls=http://localhost:7856/
```

View File

@@ -59,3 +59,8 @@
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0