From 9446655797f1a1b96c83d10a51fb32192ebb63d0 Mon Sep 17 00:00:00 2001 From: matthijsqd <56967660+matthijsqd@users.noreply.github.com> Date: Fri, 17 Dec 2021 17:16:26 +0100 Subject: [PATCH] set phoenix attributes on span creation (#52) --- .../opentelemetry_phoenix/lib/opentelemetry_phoenix.ex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/instrumentation/opentelemetry_phoenix/lib/opentelemetry_phoenix.ex b/instrumentation/opentelemetry_phoenix/lib/opentelemetry_phoenix.ex index 717fdbd..915ee86 100644 --- a/instrumentation/opentelemetry_phoenix/lib/opentelemetry_phoenix.ex +++ b/instrumentation/opentelemetry_phoenix/lib/opentelemetry_phoenix.ex @@ -122,8 +122,10 @@ defmodule OpentelemetryPhoenix do ] # start the span with a default name. Route name isn't known until router dispatch - OpentelemetryTelemetry.start_telemetry_span(@tracer_id, "HTTP #{conn.method}", meta, %{kind: :server}) - |> Span.set_attributes(attributes) + OpentelemetryTelemetry.start_telemetry_span(@tracer_id, "HTTP #{conn.method}", meta, %{ + kind: :server, + attributes: attributes + }) end @doc false