From 19ffb0afee12ae94ec38034abf6f9c59186bf5c9 Mon Sep 17 00:00:00 2001 From: Lucas Pimentel Date: Wed, 18 Dec 2024 22:55:30 -0500 Subject: [PATCH] change span_id to number everywhere --- .../docker/dotnet/parametric/Endpoints/ApmTestApi.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/utils/build/docker/dotnet/parametric/Endpoints/ApmTestApi.cs b/utils/build/docker/dotnet/parametric/Endpoints/ApmTestApi.cs index d07d096cac8..59e21a74680 100644 --- a/utils/build/docker/dotnet/parametric/Endpoints/ApmTestApi.cs +++ b/utils/build/docker/dotnet/parametric/Endpoints/ApmTestApi.cs @@ -315,17 +315,11 @@ protected static async Task FlushTraceStats() private static ISpan FindSpan(JsonElement json, string key = "span_id") { - var spanIdString = json.GetProperty(key).GetString(); - - if (!ulong.TryParse(spanIdString, out var spanId)) - { - _logger?.LogError("Required {key}:{value} not valid in request json.", key, spanIdString); - throw new InvalidOperationException($"Required {key}:{spanIdString} not valid in request json."); - } + var spanId = json.GetProperty(key).GetUInt64(); if (!Spans.TryGetValue(spanId, out var span)) { - _logger?.LogError("Span not found with span id: {spanId}.", spanIdString); + _logger?.LogError("Span not found with span id: {spanId}.", spanId); throw new InvalidOperationException($"Span not found with span id: {spanId}"); }