diff --git a/instrumentation/opentelemetry_phoenix/lib/opentelemetry_phoenix.ex b/instrumentation/opentelemetry_phoenix/lib/opentelemetry_phoenix.ex index 3844055..717fdbd 100644 --- a/instrumentation/opentelemetry_phoenix/lib/opentelemetry_phoenix.ex +++ b/instrumentation/opentelemetry_phoenix/lib/opentelemetry_phoenix.ex @@ -131,7 +131,7 @@ defmodule OpentelemetryPhoenix do # ensure the correct span is current and update the status ctx = OpentelemetryTelemetry.set_current_telemetry_span(@tracer_id, meta) - Span.set_attribute(ctx, :"http.status", conn.status) + Span.set_attribute(ctx, :"http.status_code", conn.status) if conn.status >= 400 do Span.set_status(ctx, OpenTelemetry.status(:error, "")) diff --git a/instrumentation/opentelemetry_phoenix/test/opentelemetry_phoenix_test.exs b/instrumentation/opentelemetry_phoenix/test/opentelemetry_phoenix_test.exs index 83fc776..01e8af6 100644 --- a/instrumentation/opentelemetry_phoenix/test/opentelemetry_phoenix_test.exs +++ b/instrumentation/opentelemetry_phoenix/test/opentelemetry_phoenix_test.exs @@ -65,7 +65,7 @@ defmodule OpentelemetryPhoenixTest do "http.method": "GET", "http.route": "/users/:user_id", "http.scheme": "http", - "http.status": 200, + "http.status_code": 200, "http.target": "/users/123", "http.user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:81.0) Gecko/20100101 Firefox/81.0", "net.host.ip": "10.211.55.2", @@ -155,7 +155,7 @@ defmodule OpentelemetryPhoenixTest do "http.method": "GET", "http.route": "/users/:user_id/exception", "http.scheme": "http", - "http.status": 500, + "http.status_code": 500, "http.target": "/users/123/exception", "http.user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:81.0) Gecko/20100101 Firefox/81.0", "net.host.ip": "10.211.55.2", @@ -223,7 +223,7 @@ defmodule OpentelemetryPhoenixTest do "http.method": "GET", "http.route": "/users/:user_id/exception", "http.scheme": "http", - "http.status": 500, + "http.status_code": 500, "http.target": "/users/123/exception", "http.user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:81.0) Gecko/20100101 Firefox/81.0", "net.host.ip": "10.211.55.2",