Skip to content

Commit

Permalink
Merge pull request #90 from solarwinds/bug_fix
Browse files Browse the repository at this point in the history
Bug fix on transaction naming and determining the service_name from oboe_init
  • Loading branch information
xuan-cao-swi authored Nov 6, 2023
2 parents 0b4e038 + 3a08700 commit 5e69f10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/solarwinds_apm/api/transaction_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def set_transaction_name(custom_name=nil)
status = false
else
solarwinds_processor.txn_manager.set("#{current_trace_id}-#{entry_span_id}",custom_name)
SolarWindsAPM.logger.debug {"[#{name}/#{__method__}] Cached custom transaction name for #{entry_trace_id}-#{entry_span_id} as #{custom_name}"}
SolarWindsAPM.logger.debug {"[#{name}/#{__method__}] Cached custom transaction name for #{current_trace_id}-#{entry_span_id} as #{custom_name}"}
end
else
SolarWindsAPM.logger.warn {"[#{name}/#{__method__}] Set transaction name failed: invalid span context."}
Expand Down
5 changes: 4 additions & 1 deletion lib/solarwinds_apm/oboe_init_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ def read_and_validate_service_key
otel_resource_service_name = nil
ENV['OTEL_RESOURCE_ATTRIBUTES']&.split(',')&.each do |pair|
key, value = pair.split('=')
otel_resource_service_name = value; break if key == 'service.name'
if key == 'service.name'
otel_resource_service_name = value
break
end
end

SolarWindsAPM.logger.debug {"[#{self.class}/#{__method__}] provided otel_resource_service_name #{otel_resource_service_name}"} if otel_resource_service_name
Expand Down

0 comments on commit 5e69f10

Please sign in to comment.