Skip to content

Commit

Permalink
refactor: Rename to roles
Browse files Browse the repository at this point in the history
  • Loading branch information
arielvalentin authored Sep 24, 2023
1 parent daf5d1b commit 2e532c6
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def initialize(tracer)
@tracer = tracer
end

def on_start(name, _id, payload, subscriber)
span = @tracer.start_span(name, attributes: subscriber.as_otel_semconv_attrs(payload.fetch(:job)))
def on_start(name, _id, payload, attribute_processor)
span = @tracer.start_span(name, attributes: attribute_processor.as_otel_semconv_attrs(payload.fetch(:job)))
tokens = [OpenTelemetry::Context.attach(OpenTelemetry::Trace.context_with_span(span))]
OpenTelemetry.propagation.inject(payload.fetch(:job).__otel_headers) # This must be transmitted over the wire
{ span: span, ctx_tokens: tokens }
Expand All @@ -68,7 +68,7 @@ def initialize(tracer)
@tracer = tracer
end

def on_start(name, _id, payload, subscriber)
def on_start(name, _id, payload, attribute_processor)
span = @tracer.start_span("#{payload.fetch(:job).queue_name} publish",
kind: :producer,
attributes: subscriber.as_otel_semconv_attrs(payload.fetch(:job)))
Expand All @@ -83,7 +83,7 @@ def initialize(tracer)
@tracer = tracer
end

def on_start(name, _id, payload, subscriber)
def on_start(name, _id, payload, attribute_processor)
tokens = []
parent_context = OpenTelemetry.propagation.extract(payload.fetch(:job).__otel_headers)
span_context = OpenTelemetry::Trace.current_span(parent_context).context
Expand All @@ -96,7 +96,7 @@ def on_start(name, _id, payload, subscriber)
span = @tracer.start_span(
"#{payload.fetch(:job).queue_name} process",
kind: :consumer,
attributes: subscriber.as_otel_semconv_attrs(payload.fetch(:job)),
attributes: attribute_processor.as_otel_semconv_attrs(payload.fetch(:job)),
links: links
)

Expand Down

0 comments on commit 2e532c6

Please sign in to comment.