From 4e03f9f61914631bcfbd66b7a6cec1255e7c5b0d Mon Sep 17 00:00:00 2001 From: Marc Delagrammatikas Date: Fri, 5 Jan 2024 09:49:39 -0800 Subject: [PATCH 1/2] remove opentelemetry sdk from runtime dependencies we need this for the span record definitions, but we don't want the application to actually start. --- mix.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index 1f9a983..44c558e 100644 --- a/mix.exs +++ b/mix.exs @@ -43,7 +43,7 @@ defmodule OpenTelemetryDecorator.MixProject do {:excoveralls, "~> 0.18.0", only: :test, runtime: false}, {:opentelemetry_exporter, "~> 1.4", only: :test}, {:opentelemetry_api, "~> 1.2"}, - {:opentelemetry, "~> 1.3", only: :test} + {:opentelemetry, "~> 1.3", only: :test, runtime: false} ] end From f9ef79f98c8a132db59a82e3cfcb437b89c21ecd Mon Sep 17 00:00:00 2001 From: Marc Delagrammatikas Date: Fri, 5 Jan 2024 10:47:14 -0800 Subject: [PATCH 2/2] the attributes are swapped on ci --- lib/open_telemetry_decorator/attributes_v2.ex | 1 + test/open_telemetry_decorator/attributes_v2_test.exs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/open_telemetry_decorator/attributes_v2.ex b/lib/open_telemetry_decorator/attributes_v2.ex index 9356da3..f2cd854 100644 --- a/lib/open_telemetry_decorator/attributes_v2.ex +++ b/lib/open_telemetry_decorator/attributes_v2.ex @@ -44,6 +44,7 @@ defmodule OpenTelemetryDecorator.AttributesV2 do |> prefix_name() end + # The error attribute is meaningful in the context of the span, so we don't want to prefix it defp prefix_name(:error), do: :error defp prefix_name("error"), do: :error diff --git a/test/open_telemetry_decorator/attributes_v2_test.exs b/test/open_telemetry_decorator/attributes_v2_test.exs index 8630987..b6fe318 100644 --- a/test/open_telemetry_decorator/attributes_v2_test.exs +++ b/test/open_telemetry_decorator/attributes_v2_test.exs @@ -205,7 +205,8 @@ defmodule OpenTelemetryDecorator.AttributesV2Test do test "doesn't modify keys without underscores" do attrs = Attributes.get([_id: 1, name: "asd"], [:_id, :name]) - assert attrs == [id: 1, name: "asd"] + assert Keyword.get(attrs, :id) == 1 + assert Keyword.get(attrs, :name) == "asd" end end