Skip to content

Commit

Permalink
Modify OpenTelemetry single URL to allow 'v1' in configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
GinoCanessa committed Sep 5, 2024
1 parent ba5574c commit 0eecba6
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/fhir-candle/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,22 @@ public static async Task<int> RunServer(
return general;
}

if (general.EndsWith('/'))
if (general.EndsWith("v1/"))
{
return general + relative;
}

return general + "/" + relative;
if (general.EndsWith("v1"))
{
return general + "/" + relative;
}

if (general.EndsWith('/'))
{
return general + "v1/" + relative;
}

return general + "/v1/" + relative;
}

return null;
Expand All @@ -403,19 +413,19 @@ private static void ConfigureOpenTelemetry(CandleConfig config, WebApplicationBu
string? traceEndpoint = getTelemetryUrl(
config.OpenTelemetryTracesEndpoint,
config.OpenTelemetryEndpoint,
"v1/traces",
"traces",
protocol);

string? metricsEndpoint = getTelemetryUrl(
config.OpenTelemetryMetricsEndpoint,
config.OpenTelemetryEndpoint,
"v1/metrics",
"metrics",
protocol);

string? logsEndpoint = getTelemetryUrl(
config.OpenTelemetryLogsEndpoint,
config.OpenTelemetryEndpoint,
"v1/logs",
"logs",
protocol);

if (logsEndpoint != null)
Expand Down

0 comments on commit 0eecba6

Please sign in to comment.