diff --git a/instrumentation/opentelemetry_oban/lib/opentelemetry_oban.ex b/instrumentation/opentelemetry_oban/lib/opentelemetry_oban.ex index 7a4a41a5..c6e5b16e 100644 --- a/instrumentation/opentelemetry_oban/lib/opentelemetry_oban.ex +++ b/instrumentation/opentelemetry_oban/lib/opentelemetry_oban.ex @@ -18,9 +18,8 @@ defmodule OpentelemetryOban do alias Ecto.Changeset alias OpenTelemetry.Span - alias OpenTelemetry.SemanticConventions.Trace + alias OpenTelemetry.SemConv.Incubating.MessagingAttributes - require Trace require OpenTelemetry.Tracer @doc """ @@ -55,7 +54,7 @@ defmodule OpentelemetryOban do attributes = attributes_before_insert(changeset) worker = Changeset.get_field(changeset, :worker) - OpenTelemetry.Tracer.with_span "#{worker} send", attributes: attributes, kind: :producer do + OpenTelemetry.Tracer.with_span "#{worker}.send", attributes: attributes, kind: :producer do changeset = add_tracing_information_to_meta(changeset) case Oban.insert(name, changeset) do @@ -77,7 +76,7 @@ defmodule OpentelemetryOban do attributes = attributes_before_insert(changeset) worker = Changeset.get_field(changeset, :worker) - OpenTelemetry.Tracer.with_span "#{worker} send", attributes: attributes, kind: :producer do + OpenTelemetry.Tracer.with_span "#{worker}.send", attributes: attributes, kind: :producer do changeset = add_tracing_information_to_meta(changeset) try do @@ -130,9 +129,8 @@ defmodule OpentelemetryOban do worker = Changeset.get_field(changeset, :worker) %{ - Trace.messaging_system() => :oban, - Trace.messaging_destination() => queue, - Trace.messaging_destination_kind() => :queue, + MessagingAttributes.messaging_system() => :oban, + MessagingAttributes.messaging_destination_name() => queue, :"oban.job.worker" => worker } end diff --git a/instrumentation/opentelemetry_oban/lib/opentelemetry_oban/job_handler.ex b/instrumentation/opentelemetry_oban/lib/opentelemetry_oban/job_handler.ex index 8d14f781..20a2ab19 100644 --- a/instrumentation/opentelemetry_oban/lib/opentelemetry_oban/job_handler.ex +++ b/instrumentation/opentelemetry_oban/lib/opentelemetry_oban/job_handler.ex @@ -1,8 +1,6 @@ defmodule OpentelemetryOban.JobHandler do alias OpenTelemetry.Span - alias OpenTelemetry.SemanticConventions.Trace - - require Trace + alias OpenTelemetry.SemConv.Incubating.MessagingAttributes @tracer_id __MODULE__ @@ -60,10 +58,10 @@ defmodule OpentelemetryOban.JobHandler do OpenTelemetry.Tracer.set_current_span(:undefined) attributes = %{ - Trace.messaging_system() => :oban, - Trace.messaging_destination() => queue, - Trace.messaging_destination_kind() => :queue, - Trace.messaging_operation() => :process, + MessagingAttributes.messaging_system() => :oban, + MessagingAttributes.messaging_destination_name() => queue, + MessagingAttributes.messaging_operation_type() => + MessagingAttributes.messaging_operation_type_values().process, :"oban.job.job_id" => id, :"oban.job.worker" => worker, :"oban.job.priority" => priority, @@ -73,7 +71,7 @@ defmodule OpentelemetryOban.JobHandler do :"oban.job.scheduled_at" => DateTime.to_iso8601(scheduled_at) } - span_name = "#{worker} process" + span_name = "#{worker}.process" OpentelemetryTelemetry.start_telemetry_span(@tracer_id, span_name, metadata, %{ kind: :consumer, diff --git a/instrumentation/opentelemetry_oban/mix.exs b/instrumentation/opentelemetry_oban/mix.exs index 5230d755..ec78dd42 100644 --- a/instrumentation/opentelemetry_oban/mix.exs +++ b/instrumentation/opentelemetry_oban/mix.exs @@ -47,7 +47,7 @@ defmodule OpentelemetryOban.MixProject do {:oban, "~> 2.0"}, {:opentelemetry_api, "~> 1.2"}, {:opentelemetry_telemetry, "~> 1.1"}, - {:opentelemetry_semantic_conventions, "~> 0.2"}, + {:opentelemetry_semantic_conventions, "~> 1.27"}, {:opentelemetry, "~> 1.0", only: [:test]}, {:opentelemetry_exporter, "~> 1.0", only: [:test]}, {:telemetry, "~> 0.4 or ~> 1.0"}, diff --git a/instrumentation/opentelemetry_oban/mix.lock b/instrumentation/opentelemetry_oban/mix.lock index de97e075..2cf4c3c0 100644 --- a/instrumentation/opentelemetry_oban/mix.lock +++ b/instrumentation/opentelemetry_oban/mix.lock @@ -2,28 +2,28 @@ "acceptor_pool": {:hex, :acceptor_pool, "1.0.0", "43c20d2acae35f0c2bcd64f9d2bde267e459f0f3fd23dab26485bf518c281b21", [:rebar3], [], "hexpm", "0cbcd83fdc8b9ad2eee2067ef8b91a14858a5883cb7cd800e6fcd5803e158788"}, "chatterbox": {:hex, :ts_chatterbox, "0.15.1", "5cac4d15dd7ad61fc3c4415ce4826fc563d4643dee897a558ec4ea0b1c835c9c", [:rebar3], [{:hpack, "~> 0.3.0", [hex: :hpack_erl, repo: "hexpm", optional: false]}], "hexpm", "4f75b91451338bc0da5f52f3480fa6ef6e3a2aeecfc33686d6b3d0a0948f31aa"}, "ctx": {:hex, :ctx, "0.6.0", "8ff88b70e6400c4df90142e7f130625b82086077a45364a78d208ed3ed53c7fe", [:rebar3], [], "hexpm", "a14ed2d1b67723dbebbe423b28d7615eb0bdcba6ff28f2d1f1b0a7e1d4aa5fc2"}, - "db_connection": {:hex, :db_connection, "2.6.0", "77d835c472b5b67fc4f29556dee74bf511bbafecdcaf98c27d27fa5918152086", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c2f992d15725e721ec7fbc1189d4ecdb8afef76648c746a8e1cad35e3b8a35f3"}, + "db_connection": {:hex, :db_connection, "2.7.0", "b99faa9291bb09892c7da373bb82cba59aefa9b36300f6145c5f201c7adf48ec", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dcf08f31b2701f857dfc787fbad78223d61a32204f217f15e881dd93e4bdd3ff"}, "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"}, - "ecto": {:hex, :ecto, "3.11.1", "4b4972b717e7ca83d30121b12998f5fcdc62ba0ed4f20fd390f16f3270d85c3e", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ebd3d3772cd0dfcd8d772659e41ed527c28b2a8bde4b00fe03e0463da0f1983b"}, - "ecto_sql": {:hex, :ecto_sql, "3.11.1", "e9abf28ae27ef3916b43545f9578b4750956ccea444853606472089e7d169470", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ce14063ab3514424276e7e360108ad6c2308f6d88164a076aac8a387e1fea634"}, - "ex_doc": {:hex, :ex_doc, "0.34.1", "9751a0419bc15bc7580c73fde506b17b07f6402a1e5243be9e0f05a68c723368", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "d441f1a86a235f59088978eff870de2e815e290e44a8bd976fe5d64470a4c9d2"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"}, + "ecto": {:hex, :ecto, "3.12.4", "267c94d9f2969e6acc4dd5e3e3af5b05cdae89a4d549925f3008b2b7eb0b93c3", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ef04e4101688a67d061e1b10d7bc1fbf00d1d13c17eef08b71d070ff9188f747"}, + "ecto_sql": {:hex, :ecto_sql, "3.12.1", "c0d0d60e85d9ff4631f12bafa454bc392ce8b9ec83531a412c12a0d415a3a4d0", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.12", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "aff5b958a899762c5f09028c847569f7dfb9cc9d63bdb8133bff8a5546de6bf5"}, + "ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"}, "gproc": {:hex, :gproc, "0.9.1", "f1df0364423539cf0b80e8201c8b1839e229e5f9b3ccb944c5834626998f5b8c", [:rebar3], [], "hexpm", "905088e32e72127ed9466f0bac0d8e65704ca5e73ee5a62cb073c3117916d507"}, "grpcbox": {:hex, :grpcbox, "0.17.1", "6e040ab3ef16fe699ffb513b0ef8e2e896da7b18931a1ef817143037c454bcce", [:rebar3], [{:acceptor_pool, "~> 1.0.0", [hex: :acceptor_pool, repo: "hexpm", optional: false]}, {:chatterbox, "~> 0.15.1", [hex: :ts_chatterbox, repo: "hexpm", optional: false]}, {:ctx, "~> 0.6.0", [hex: :ctx, repo: "hexpm", optional: false]}, {:gproc, "~> 0.9.1", [hex: :gproc, repo: "hexpm", optional: false]}], "hexpm", "4a3b5d7111daabc569dc9cbd9b202a3237d81c80bf97212fbc676832cb0ceb17"}, "hpack": {:hex, :hpack_erl, "0.3.0", "2461899cc4ab6a0ef8e970c1661c5fc6a52d3c25580bc6dd204f84ce94669926", [:rebar3], [], "hexpm", "d6137d7079169d8c485c6962dfe261af5b9ef60fbc557344511c1e65e3d95fb0"}, - "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, + "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"}, "makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"}, - "makeup_erlang": {:hex, :makeup_erlang, "1.0.0", "6f0eff9c9c489f26b69b61440bf1b238d95badae49adac77973cbacae87e3c2e", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "ea7a9307de9d1548d2a72d299058d1fd2339e3d398560a0e46c27dab4891e4d2"}, + "makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, - "oban": {:hex, :oban, "2.17.4", "3ebe79dc0cad16f23e5feea418f9bc5b07d453b8fb7caf376d812be96157a5c5", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "71a804abea3bb7e104782a5b5337cbab76c1a56b9689a6d5159a3873c93898b6"}, - "opentelemetry": {:hex, :opentelemetry, "1.3.1", "f0a342a74379e3540a634e7047967733da4bc8b873ec9026e224b2bd7369b1fc", [:rebar3], [{:opentelemetry_api, "~> 1.2.2", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "de476b2ac4faad3e3fe3d6e18b35dec9cb338c3b9910c2ce9317836dacad3483"}, - "opentelemetry_api": {:hex, :opentelemetry_api, "1.2.2", "693f47b0d8c76da2095fe858204cfd6350c27fe85d00e4b763deecc9588cf27a", [:mix, :rebar3], [{:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "dc77b9a00f137a858e60a852f14007bb66eda1ffbeb6c05d5fe6c9e678b05e9d"}, - "opentelemetry_exporter": {:hex, :opentelemetry_exporter, "1.6.0", "f4fbf69aa9f1541b253813221b82b48a9863bc1570d8ecc517bc510c0d1d3d8c", [:rebar3], [{:grpcbox, ">= 0.0.0", [hex: :grpcbox, repo: "hexpm", optional: false]}, {:opentelemetry, "~> 1.3", [hex: :opentelemetry, repo: "hexpm", optional: false]}, {:opentelemetry_api, "~> 1.2", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:tls_certificate_check, "~> 1.18", [hex: :tls_certificate_check, repo: "hexpm", optional: false]}], "hexpm", "1802d1dca297e46f21e5832ecf843c451121e875f73f04db87355a6cb2ba1710"}, - "opentelemetry_semantic_conventions": {:hex, :opentelemetry_semantic_conventions, "0.2.0", "b67fe459c2938fcab341cb0951c44860c62347c005ace1b50f8402576f241435", [:mix, :rebar3], [], "hexpm", "d61fa1f5639ee8668d74b527e6806e0503efc55a42db7b5f39939d84c07d6895"}, - "opentelemetry_telemetry": {:hex, :opentelemetry_telemetry, "1.1.1", "4a73bfa29d7780ffe33db345465919cef875034854649c37ac789eb8e8f38b21", [:mix, :rebar3], [{:opentelemetry_api, "~> 1.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ee43b14e6866123a3ee1344e3c0d3d7591f4537542c2a925fcdbf46249c9b50b"}, - "postgrex": {:hex, :postgrex, "0.17.4", "5777781f80f53b7c431a001c8dad83ee167bcebcf3a793e3906efff680ab62b3", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "6458f7d5b70652bc81c3ea759f91736c16a31be000f306d3c64bcdfe9a18b3cc"}, + "oban": {:hex, :oban, "2.18.3", "1608c04f8856c108555c379f2f56bc0759149d35fa9d3b825cb8a6769f8ae926", [:mix], [{:ecto_sql, "~> 3.10", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "36ca6ca84ef6518f9c2c759ea88efd438a3c81d667ba23b02b062a0aa785475e"}, + "opentelemetry": {:hex, :opentelemetry, "1.5.0", "7dda6551edfc3050ea4b0b40c0d2570423d6372b97e9c60793263ef62c53c3c2", [:rebar3], [{:opentelemetry_api, "~> 1.4", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}], "hexpm", "cdf4f51d17b592fc592b9a75f86a6f808c23044ba7cf7b9534debbcc5c23b0ee"}, + "opentelemetry_api": {:hex, :opentelemetry_api, "1.4.0", "63ca1742f92f00059298f478048dfb826f4b20d49534493d6919a0db39b6db04", [:mix, :rebar3], [], "hexpm", "3dfbbfaa2c2ed3121c5c483162836c4f9027def469c41578af5ef32589fcfc58"}, + "opentelemetry_exporter": {:hex, :opentelemetry_exporter, "1.8.0", "5d546123230771ef4174e37bedfd77e3374913304cd6ea3ca82a2add49cd5d56", [:rebar3], [{:grpcbox, ">= 0.0.0", [hex: :grpcbox, repo: "hexpm", optional: false]}, {:opentelemetry, "~> 1.5.0", [hex: :opentelemetry, repo: "hexpm", optional: false]}, {:opentelemetry_api, "~> 1.4.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:tls_certificate_check, "~> 1.18", [hex: :tls_certificate_check, repo: "hexpm", optional: false]}], "hexpm", "a1f9f271f8d3b02b81462a6bfef7075fd8457fdb06adff5d2537df5e2264d9af"}, + "opentelemetry_semantic_conventions": {:hex, :opentelemetry_semantic_conventions, "1.27.0", "acd0194a94a1e57d63da982ee9f4a9f88834ae0b31b0bd850815fe9be4bbb45f", [:mix, :rebar3], [], "hexpm", "9681ccaa24fd3d810b4461581717661fd85ff7019b082c2dff89c7d5b1fc2864"}, + "opentelemetry_telemetry": {:hex, :opentelemetry_telemetry, "1.1.2", "410ab4d76b0921f42dbccbe5a7c831b8125282850be649ee1f70050d3961118a", [:mix, :rebar3], [{:opentelemetry_api, "~> 1.3", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.1", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "641ab469deb181957ac6d59bce6e1321d5fe2a56df444fc9c19afcad623ab253"}, + "postgrex": {:hex, :postgrex, "0.19.2", "34d6884a332c7bf1e367fc8b9a849d23b43f7da5c6e263def92784d03f9da468", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "618988886ab7ae8561ebed9a3c7469034bf6a88b8995785a3378746a4b9835ec"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, - "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, - "tls_certificate_check": {:hex, :tls_certificate_check, "1.21.0", "042ab2c0c860652bc5cf69c94e3a31f96676d14682e22ec7813bd173ceff1788", [:rebar3], [{:ssl_verify_fun, "~> 1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "6cee6cffc35a390840d48d463541d50746a7b0e421acaadb833cfc7961e490e7"}, + "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, + "tls_certificate_check": {:hex, :tls_certificate_check, "1.24.0", "d00e2887551ff8cdae4d0340d90d9fcbc4943c7b5f49d32ed4bc23aff4db9a44", [:rebar3], [{:ssl_verify_fun, "~> 1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "90b25a58ee433d91c17f036d4d354bf8859a089bfda60e68a86f8eecae45ef1b"}, } diff --git a/instrumentation/opentelemetry_oban/test/opentelemetry_oban/plugin_handler_test.exs b/instrumentation/opentelemetry_oban/test/opentelemetry_oban/plugin_handler_test.exs index 87e93aac..aceab172 100644 --- a/instrumentation/opentelemetry_oban/test/opentelemetry_oban/plugin_handler_test.exs +++ b/instrumentation/opentelemetry_oban/test/opentelemetry_oban/plugin_handler_test.exs @@ -103,7 +103,7 @@ defmodule OpentelemetryOban.PluginHandlerTest do [ event( - name: "exception", + name: :exception, attributes: event_attributes ) ] = :otel_events.list(events) diff --git a/instrumentation/opentelemetry_oban/test/opentelemetry_oban_test.exs b/instrumentation/opentelemetry_oban/test/opentelemetry_oban_test.exs index de3828de..f628d9b9 100644 --- a/instrumentation/opentelemetry_oban/test/opentelemetry_oban_test.exs +++ b/instrumentation/opentelemetry_oban/test/opentelemetry_oban_test.exs @@ -37,7 +37,7 @@ defmodule OpentelemetryObanTest do assert_receive {:span, span( - name: "TestJob send", + name: "TestJob.send", attributes: attributes, parent_span_id: :undefined, kind: :producer, @@ -45,13 +45,12 @@ defmodule OpentelemetryObanTest do )} assert %{ - "messaging.destination": "events", - "messaging.destination_kind": :queue, + "messaging.destination.name": "events", + "messaging.system": :oban, "oban.job.job_id": _job_id, "oban.job.max_attempts": 1, - "oban.job.priority": 0, - "oban.job.worker": "TestJob", - "messaging.system": :oban + "oban.job.priority": nil, + "oban.job.worker": "TestJob" } = :otel_attributes.map(attributes) end @@ -66,7 +65,7 @@ defmodule OpentelemetryObanTest do assert_receive {:span, span( - name: "TestJob send", + name: "TestJob.send", attributes: _attributes, trace_id: ^root_trace_id, parent_span_id: ^root_span_id, @@ -89,7 +88,7 @@ defmodule OpentelemetryObanTest do assert_receive {:span, span( - name: "TestJob send", + name: "TestJob.send", attributes: _attributes, trace_id: send_trace_id, span_id: send_span_id, @@ -99,7 +98,7 @@ defmodule OpentelemetryObanTest do assert_receive {:span, span( - name: "TestJob process", + name: "TestJob.process", attributes: _attributes, kind: :consumer, status: :undefined, @@ -121,7 +120,7 @@ defmodule OpentelemetryObanTest do assert_receive {:span, span( - name: "TestJob process", + name: "TestJob.process", attributes: _attributes, kind: :consumer, status: :undefined, @@ -138,24 +137,23 @@ defmodule OpentelemetryObanTest do assert_receive {:span, span( - name: "TestJob process", + name: "TestJob.process", attributes: attributes, kind: :consumer, status: :undefined )} assert %{ - "messaging.destination": "events", - "messaging.destination_kind": :queue, + "messaging.destination.name": "events", + "messaging.operation.type": :process, + "messaging.system": :oban, "oban.job.attempt": 1, "oban.job.inserted_at": _inserted_at, "oban.job.job_id": _job_id, "oban.job.max_attempts": 1, "oban.job.priority": 0, "oban.job.scheduled_at": _scheduled_at, - "oban.job.worker": "TestJob", - "messaging.operation": :process, - "messaging.system": :oban + "oban.job.worker": "TestJob" } = :otel_attributes.map(attributes) end @@ -167,7 +165,7 @@ defmodule OpentelemetryObanTest do assert_receive {:span, span( - name: "TestJobThatReturnsError process", + name: "TestJobThatReturnsError.process", attributes: attributes, kind: :consumer, events: events, @@ -175,22 +173,21 @@ defmodule OpentelemetryObanTest do )} assert %{ - "messaging.destination": "events", - "messaging.destination_kind": :queue, + "messaging.destination.name": "events", + "messaging.operation.type": :process, + "messaging.system": :oban, "oban.job.attempt": 1, "oban.job.inserted_at": _inserted_at, "oban.job.job_id": _job_id, "oban.job.max_attempts": 1, "oban.job.priority": 0, "oban.job.scheduled_at": _scheduled_at, - "oban.job.worker": "TestJobThatReturnsError", - "messaging.operation": :process, - "messaging.system": :oban + "oban.job.worker": "TestJobThatReturnsError" } = :otel_attributes.map(attributes) [ event( - name: "exception", + name: :exception, attributes: event_attributes ) ] = :otel_events.list(events) @@ -209,14 +206,14 @@ defmodule OpentelemetryObanTest do assert_receive {:span, span( - name: "TestJobThatReturnsError send", + name: "TestJobThatReturnsError.send", trace_id: send_trace_id, span_id: send_span_id )} assert_receive {:span, span( - name: "TestJobThatReturnsError process", + name: "TestJobThatReturnsError.process", status: ^expected_status, trace_id: first_process_trace_id, links: job_1_links @@ -226,7 +223,7 @@ defmodule OpentelemetryObanTest do assert_receive {:span, span( - name: "TestJobThatReturnsError process", + name: "TestJobThatReturnsError.process", status: ^expected_status, trace_id: second_process_trace_id, links: job_2_links @@ -245,7 +242,7 @@ defmodule OpentelemetryObanTest do assert_receive {:span, span( - name: "TestJobThatThrowsException process", + name: "TestJobThatThrowsException.process", attributes: attributes, kind: :consumer, events: events, @@ -253,22 +250,21 @@ defmodule OpentelemetryObanTest do )} assert %{ - "messaging.destination": "events", - "messaging.destination_kind": :queue, + "messaging.destination.name": "events", + "messaging.operation.type": :process, + "messaging.system": :oban, "oban.job.attempt": 1, "oban.job.inserted_at": _inserted_at, "oban.job.job_id": _job_id, "oban.job.max_attempts": 1, "oban.job.priority": 0, "oban.job.scheduled_at": _scheduled_at, - "oban.job.worker": "TestJobThatThrowsException", - "messaging.operation": :process, - "messaging.system": :oban + "oban.job.worker": "TestJobThatThrowsException" } = :otel_attributes.map(attributes) [ event( - name: "exception", + name: :exception, attributes: event_attributes ) ] = :otel_events.list(events) @@ -283,7 +279,7 @@ defmodule OpentelemetryObanTest do assert_receive {:span, span( - name: "TestJobWithInnerSpan process", + name: "TestJobWithInnerSpan.process", kind: :consumer, trace_id: trace_id, span_id: process_span_id @@ -301,8 +297,8 @@ defmodule OpentelemetryObanTest do test "OpentelemetryOban.insert!/2 returns job on successful insert" do %Oban.Job{} = OpentelemetryOban.insert!(TestJob.new(%{})) assert %{success: 1, failure: 0} = Oban.drain_queue(queue: :events) - assert_receive {:span, span(name: "TestJob send")} - assert_receive {:span, span(name: "TestJob process")} + assert_receive {:span, span(name: "TestJob.send")} + assert_receive {:span, span(name: "TestJob.process")} end test "OpentelemetryOban.insert!/2 raises an error on failed insert" do @@ -317,14 +313,14 @@ defmodule OpentelemetryObanTest do assert_receive {:span, span( - name: "TestJob send", + name: "TestJob.send", events: events, status: ^expected_status )} [ event( - name: "exception", + name: :exception, attributes: event_attributes ) ] = :otel_events.list(events) @@ -332,7 +328,7 @@ defmodule OpentelemetryObanTest do assert [:"exception.message", :"exception.stacktrace", :"exception.type"] == Enum.sort(Map.keys(:otel_attributes.map(event_attributes))) - refute_received {:span, span(name: "TestJob process")} + refute_received {:span, span(name: "TestJob.process")} end test "tracing information is propagated when using insert_all/2" do @@ -355,7 +351,7 @@ defmodule OpentelemetryObanTest do assert_receive {:span, span( - name: "TestJob process", + name: "TestJob.process", attributes: _attributes, kind: :consumer, status: :undefined, @@ -367,7 +363,7 @@ defmodule OpentelemetryObanTest do assert_receive {:span, span( - name: "TestJob process", + name: "TestJob.process", attributes: _attributes, kind: :consumer, status: :undefined, @@ -387,6 +383,6 @@ defmodule OpentelemetryObanTest do test "works with Oban.Testing.perform_job helper function" do Oban.Testing.perform_job(TestJob, %{}, repo: TestRepo) - assert_receive {:span, span(name: "TestJob process")} + assert_receive {:span, span(name: "TestJob.process")} end end