Class: Instana::Exporter::Otlp::RpcConverter
- Inherits:
-
BaseConverter
- Object
- BaseConverter
- Instana::Exporter::Otlp::RpcConverter
- Defined in:
- lib/instana/exporter/otlp/rpc_converter.rb
Overview
Converter for RPC spans (gRPC, ActionCable) to OTLP format
Instance Method Summary collapse
- #convert_attributes ⇒ Object
-
#span_name ⇒ String
Build OTel-compliant span name for RPC spans.
Methods inherited from BaseConverter
Constructor Details
This class inherits a constructor from Instana::Exporter::Otlp::BaseConverter
Instance Method Details
#convert_attributes ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/instana/exporter/otlp/rpc_converter.rb', line 33 def convert_attributes attributes = {} rpc_data = span[:data]&.[](:rpc) return attributes unless rpc_data # Check if this is an ActionCable span if rpc_data[:flavor] == :actioncable convert_action_cable_attributes(attributes, rpc_data) else convert_grpc_attributes(attributes, rpc_data) end attributes end |
#span_name ⇒ String
Build OTel-compliant span name for RPC spans
Formulas per SPAN_NAME_PATTERNS.txt Section 4:
gRPC → "{package.Service/Method}" (leading "/" stripped per OTel spec)
ActionCable → "{ChannelClass#action}" (call string used as-is)
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/instana/exporter/otlp/rpc_converter.rb', line 22 def span_name rpc_data = span[:data]&.[](:rpc) || {} if rpc_data[:flavor] == :actioncable rpc_data[:call].to_s else # Strip the mandatory leading slash per gRPC/OTel spec rpc_data[:call].to_s.delete_prefix('/') end.then { |n| n.empty? ? super : n } end |