diff --git a/lib/mv_opentelemetry/finch.ex b/lib/mv_opentelemetry/finch.ex index 4511d82..c4620b3 100644 --- a/lib/mv_opentelemetry/finch.ex +++ b/lib/mv_opentelemetry/finch.ex @@ -53,11 +53,7 @@ defmodule MvOpentelemetry.Finch do ctx = OpentelemetryTelemetry.set_current_telemetry_span(opts[:tracer_id], meta) if status do - Span.set_attributes(ctx, %{ - # Remove this field after some time in favour of Trace.http_status_code() - :"http.status" => status, - Trace.http_status_code() => status - }) + Span.set_attributes(ctx, %{Trace.http_status_code() => status}) end if error do diff --git a/lib/mv_opentelemetry/plug.ex b/lib/mv_opentelemetry/plug.ex index f101fa8..9462ae9 100644 --- a/lib/mv_opentelemetry/plug.ex +++ b/lib/mv_opentelemetry/plug.ex @@ -68,8 +68,6 @@ defmodule MvOpentelemetry.Plug do attributes = [ {Trace.http_client_ip(), client_ip}, - # Remove this field after some time in favour of Trace.net_peer_name() - {:"http.host", conn.host}, {Trace.net_peer_name(), conn.host}, {Trace.http_method(), conn.method}, {Trace.http_scheme(), "#{conn.scheme}"}, @@ -110,11 +108,7 @@ defmodule MvOpentelemetry.Plug do def handle_stop_event(_, _, %{conn: conn} = meta, opts) do ctx = OpentelemetryTelemetry.set_current_telemetry_span(opts[:tracer_id], meta) - Span.set_attributes(ctx, %{ - # Remove this field after some time in favour of Trace.http_status_code() - :"http.status" => conn.status, - Trace.http_status_code() => conn.status - }) + Span.set_attributes(ctx, %{Trace.http_status_code() => conn.status}) if conn.status >= 400 do Span.set_status(ctx, OpenTelemetry.status(:error, "")) diff --git a/lib/mv_opentelemetry/tesla.ex b/lib/mv_opentelemetry/tesla.ex index db06d69..3c3863b 100644 --- a/lib/mv_opentelemetry/tesla.ex +++ b/lib/mv_opentelemetry/tesla.ex @@ -62,11 +62,7 @@ defmodule MvOpentelemetry.Tesla do ctx = OpentelemetryTelemetry.set_current_telemetry_span(opts[:tracer_id], meta) if status do - Span.set_attributes(ctx, %{ - # Remove this field after some time in favour of Trace.http_status_code() - :"http.status" => status, - Trace.http_status_code() => status - }) + Span.set_attributes(ctx, %{Trace.http_status_code() => status}) end if error do diff --git a/mix.exs b/mix.exs index b0546e0..c0ff554 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule MvOpentelemetry.MixProject do def project do [ app: :mv_opentelemetry, - version: "1.14.0", + version: "2.0.0", elixir: "~> 1.14", elixirc_paths: elixirc_paths(Mix.env()), compilers: Mix.compilers(), diff --git a/test/mv_opentelemetry/finch_test.exs b/test/mv_opentelemetry/finch_test.exs index 30aa6f0..b55c1c9 100644 --- a/test/mv_opentelemetry/finch_test.exs +++ b/test/mv_opentelemetry/finch_test.exs @@ -57,8 +57,6 @@ defmodule MvOpentelemetry.FinchTest do assert :client == span(span_record, :kind) assert {:"http.status_code", 200} in attributes - assert {:"http.status", 200} in attributes - assert {:"http.host", "localhost"} in attributes assert {:"net.peer.name", "localhost"} in attributes assert {:"http.method", "GET"} in attributes assert {:"http.target", "/"} in attributes diff --git a/test/mv_opentelemetry/plug_test.exs b/test/mv_opentelemetry/plug_test.exs index 3fc6b3c..3e0c5bb 100644 --- a/test/mv_opentelemetry/plug_test.exs +++ b/test/mv_opentelemetry/plug_test.exs @@ -16,11 +16,9 @@ defmodule MvOpentelemetry.PlugTest do {:attributes, _, _, _, attributes} = span(span_record, :attributes) keys = Enum.map(attributes, fn {k, _v} -> k end) - assert {:"http.status", 200} in attributes assert {:"http.status_code", 200} in attributes assert {:"http.method", "GET"} in attributes assert {:"http.flavor", ""} in attributes - assert {:"http.host", "www.example.com"} in attributes assert {:"net.peer.name", "www.example.com"} in attributes assert {:"http.target", "/"} in attributes assert {"service.component", "test.harness"} in attributes @@ -77,7 +75,6 @@ defmodule MvOpentelemetry.PlugTest do {:attributes, _, _, _, attributes} = span(span_record, :attributes) keys = Enum.map(attributes, fn {k, _v} -> k end) - assert {:"http.status", 200} in attributes assert {:"http.status_code", 200} in attributes assert {:"http.method", "GET"} in attributes assert {:"http.flavor", ""} in attributes