opentelemetry_phoenix http.status -> http_status_code (#42)

This commit is contained in:
Ho-Yon Mak 2021-11-19 14:15:43 +00:00 committed by GitHub
parent f21b315e3e
commit 3f43f8dd9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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, ""))

View File

@ -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",