Update OpenTelemetry exporter configuration

This commit is contained in:
Simon Larsen 2023-12-30 22:08:37 +00:00
parent a27c94395e
commit a6d1b29770
No known key found for this signature in database
GPG key ID: AB45983AA9C81CDE
7 changed files with 20 additions and 7 deletions

View file

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

View file

@ -46,3 +46,6 @@
2.0
2.0
2.0
2.0
2.0
2.0

View file

@ -325,8 +325,20 @@ server {
proxy_pass http://accounts;
}
location /opentelemetry-collector {
grpc_pass grpc://${SERVER_OTEL_COLLECTOR_HOSTNAME}:${OTEL_COLLECTOR_GRPC_PORT};
location /opentelemetry-collector/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://opentelemetry-collector/;
}
location /notification {