Skip to content

Commit

Permalink
chore(broadway): update opentelemetry_semantic_attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
klacointe committed Dec 10, 2024
1 parent a4ee9fe commit d0b53a8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ defmodule OpentelemetryBroadway do
"""

alias OpenTelemetry.SemanticConventions
alias OpenTelemetry.Span
alias OpenTelemetry.SemanticConventions.Trace
alias OpenTelemetry.SemConv.Incubating.MessagingAttributes

require Trace

Expand Down Expand Up @@ -72,16 +72,16 @@ defmodule OpentelemetryBroadway do
client_id = inspect(name)

attributes = %{
SemanticConventions.Trace.messaging_system() => :broadway,
SemanticConventions.Trace.messaging_operation() => :process,
SemanticConventions.Trace.messaging_consumer_id() => client_id
MessagingAttributes.messaging_system() => :broadway,
MessagingAttributes.messaging_operation_type() => :process,
MessagingAttributes.messaging_client_id() => client_id
}

attributes =
if is_binary(message.data) do
Map.put(
attributes,
SemanticConventions.Trace.messaging_message_payload_size_bytes(),
MessagingAttributes.messaging_message_body_size(),
byte_size(message.data)
)
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule OpentelemetryBroadway.JobHandler do
alias OpenTelemetry.SemanticConventions
alias OpenTelemetry.Span
alias OpenTelemetry.SemanticConventions.Trace
alias OpenTelemetry.SemConv.Incubating.MessagingAttributes

require Trace

Expand Down Expand Up @@ -50,16 +50,16 @@ defmodule OpentelemetryBroadway.JobHandler do
client_id = inspect(name)

attributes = %{
SemanticConventions.Trace.messaging_system() => :broadway,
SemanticConventions.Trace.messaging_operation() => :process,
SemanticConventions.Trace.messaging_consumer_id() => client_id
MessagingAttributes.messaging_system() => :broadway,
MessagingAttributes.messaging_operation_type() => :process,
MessagingAttributes.messaging_client_id() => client_id
}

attributes =
if is_binary(message.data) do
Map.put(
attributes,
SemanticConventions.Trace.messaging_message_payload_size_bytes(),
MessagingAttributes.messaging_message_body_size(),
byte_size(message.data)
)
else
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/opentelemetry_broadway/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ defmodule OpentelemetryBroadway.MixProject do
{:broadway, "~> 1.0"},
{:opentelemetry_api, "~> 1.0"},
{:opentelemetry_telemetry, "~> 1.0"},
{:opentelemetry_semantic_conventions, "~> 0.2"},
{:opentelemetry_semantic_conventions, "~> 1.27"},
{:telemetry, "~> 0.4 or ~> 1.0"},
{:opentelemetry, "~> 1.0", only: [:test]},
{:opentelemetry_exporter, "~> 1.0", only: [:test]},
Expand Down
6 changes: 3 additions & 3 deletions instrumentation/opentelemetry_broadway/mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"},
"nimble_options": {:hex, :nimble_options, "1.0.2", "92098a74df0072ff37d0c12ace58574d26880e522c22801437151a159392270e", [:mix], [], "hexpm", "fd12a8db2021036ce12a309f26f564ec367373265b53e25403f0ee697380f1b8"},
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
"opentelemetry": {:hex, :opentelemetry, "1.3.0", "988ac3c26acac9720a1d4fb8d9dc52e95b45ecfec2d5b5583276a09e8936bc5e", [:rebar3], [{:opentelemetry_api, "~> 1.2.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "8e09edc26aad11161509d7ecad854a3285d88580f93b63b0b1cf0bac332bfcc0"},
"opentelemetry_api": {:hex, :opentelemetry_api, "1.2.1", "7b69ed4f40025c005de0b74fce8c0549625d59cb4df12d15c32fe6dc5076ff42", [:mix, :rebar3], [{:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "6d7a27b7cad2ad69a09cabf6670514cafcec717c8441beb5c96322bac3d05350"},
"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.5.0", "7f866236d7018c20de28ebc379c02b4b0d4fd6cfd058cd15351412e7b390a733", [: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", "662fac229eba0114b3a9d1538fdf564bb46ca037cdb6d0e5fdc4c5d0da7a21be"},
"opentelemetry_semantic_conventions": {:hex, :opentelemetry_semantic_conventions, "0.2.0", "b67fe459c2938fcab341cb0951c44860c62347c005ace1b50f8402576f241435", [:mix, :rebar3], [], "hexpm", "d61fa1f5639ee8668d74b527e6806e0503efc55a42db7b5f39939d84c07d6895"},
"opentelemetry_semantic_conventions": {:hex, :opentelemetry_semantic_conventions, "1.27.0", "acd0194a94a1e57d63da982ee9f4a9f88834ae0b31b0bd850815fe9be4bbb45f", [:mix, :rebar3], [], "hexpm", "9681ccaa24fd3d810b4461581717661fd85ff7019b082c2dff89c7d5b1fc2864"},
"opentelemetry_telemetry": {:hex, :opentelemetry_telemetry, "1.0.0", "d5982a319e725fcd2305b306b65c18a86afdcf7d96821473cf0649ff88877615", [:mix, :rebar3], [{:opentelemetry_api, "~> 1.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_registry, "~> 0.3.0", [hex: :telemetry_registry, repo: "hexpm", optional: false]}], "hexpm", "3401d13a1d4b7aa941a77e6b3ec074f0ae77f83b5b2206766ce630123a9291a9"},
"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"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ defmodule OpentelemetryBroadwayTest do

assert %{
"messaging.system": :broadway,
"messaging.operation": :process,
"messaging.message_payload_size_bytes": 7
"messaging.operation.type": :process,
"messaging.message.body.size": 7
} = :otel_attributes.map(attributes)
end

Expand Down

0 comments on commit d0b53a8

Please sign in to comment.