Update OTel exporter headers and endpoints

This commit is contained in:
Simon Larsen
2024-02-15 13:45:13 +00:00
parent 6b0dd27052
commit f4d5b9c492
4 changed files with 12 additions and 11 deletions

View File

@@ -5,12 +5,12 @@
Please use
```bash
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/
export OTEL_EXPORTER_OTLP_HEADERS="x-oneuptime-service-token=3be58190-c7ec-11ee-8e5e-3952f961cde5" && 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/
export OTEL_EXPORTER_OTLP_HEADERS="x-oneuptime-service-token=3be58190-c7ec-11ee-8e5e-3952f961cde5" && export OTEL_EXPORTER_OTLP_ENDPOINT="https://test-otlp.oneuptime.com" && dotnet run --urls=http://localhost:7856/
```

View File

@@ -65,3 +65,7 @@
2.0
2.0
2.0
2.0
2.0
2.0
2.0

View File

@@ -63,13 +63,13 @@ class OpenTelemetryRequestMiddleware {
try {
let productType: ProductType;
if (req.baseUrl === '/otlp/v1/traces') {
if (req.url.includes('/otlp/v1/traces')) {
req.body = TracesData.decode(req.body);
productType = ProductType.Traces;
} else if (req.baseUrl === '/otlp/v1/logs') {
} else if (req.url.includes('/otlp/v1/logs')) {
req.body = LogsData.decode(req.body);
productType = ProductType.Logs;
} else if (req.baseUrl === '/otlp/v1/metrics') {
} else if (req.url.includes('/otlp/v1/metrics')) {
req.body = MetricsData.decode(req.body);
productType = ProductType.Metrics;
} else {

View File

@@ -39,8 +39,7 @@ server {
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
listen 80;
http2 on;
listen 80 http2;
server_name oneuptime-opentelemetry-collector ${OTEL_COLLECTOR_HOST};
@@ -80,8 +79,7 @@ server {
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
listen 80;
http2 on;
listen 80 http2;
server_name oneuptime-fluentd-collector ${FLUENTD_HOST};
@@ -300,8 +298,7 @@ server {
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
listen 80;
http2 on;
listen 80 http2;
server_name localhost ${HOST}; #All domains