Class: Datadog::Tracing::Contrib::GRPC::Formatting::FullMethodStringFormatter
- Inherits:
-
Object
- Object
- Datadog::Tracing::Contrib::GRPC::Formatting::FullMethodStringFormatter
- Defined in:
- lib/datadog/tracing/contrib/grpc/formatting.rb
Overview
A class to extract GRPC span attributes from the full method string.
Instance Attribute Summary collapse
-
#grpc_full_method ⇒ Object
readonly
grpc_full_method is a string containing all the rpc method information (from the Protobuf definition) in a single string with the following format: /$package.$service/$method.
-
#resource_name ⇒ Object
readonly
resource_name is used for the span resource name.
-
#rpc_service ⇒ Object
readonly
rpc_service represents the $package.$service part of the grpc_full_method string.
Instance Method Summary collapse
-
#initialize(grpc_full_method) ⇒ FullMethodStringFormatter
constructor
A new instance of FullMethodStringFormatter.
Constructor Details
#initialize(grpc_full_method) ⇒ FullMethodStringFormatter
Returns a new instance of FullMethodStringFormatter.
98 99 100 101 102 |
# File 'lib/datadog/tracing/contrib/grpc/formatting.rb', line 98 def initialize(grpc_full_method) @grpc_full_method = grpc_full_method @resource_name = format_resource_name(grpc_full_method) @rpc_service = extract_grpc_service(grpc_full_method) end |
Instance Attribute Details
#grpc_full_method ⇒ Object (readonly)
grpc_full_method is a string containing all the rpc method information (from the Protobuf definition) in a single string with the following format: /$package.$service/$method
90 91 92 |
# File 'lib/datadog/tracing/contrib/grpc/formatting.rb', line 90 def grpc_full_method @grpc_full_method end |
#resource_name ⇒ Object (readonly)
resource_name is used for the span resource name.
93 94 95 |
# File 'lib/datadog/tracing/contrib/grpc/formatting.rb', line 93 def resource_name @resource_name end |
#rpc_service ⇒ Object (readonly)
rpc_service represents the $package.$service part of the grpc_full_method string.
96 97 98 |
# File 'lib/datadog/tracing/contrib/grpc/formatting.rb', line 96 def rpc_service @rpc_service end |