Class: Datadog::Tracing::Contrib::GRPC::Formatting::MethodObjectFormatter
- Inherits:
-
Object
- Object
- Datadog::Tracing::Contrib::GRPC::Formatting::MethodObjectFormatter
- Defined in:
- lib/datadog/tracing/contrib/grpc/formatting.rb
Overview
A class to extract GRPC span attributes from the GRPC implementing class method object.
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.
-
#legacy_grpc_method ⇒ Object
readonly
legacy_grpc_method is built using the Ruby GRPC service implementation method name instead of the rpc interface representation from Protobuf.
-
#legacy_grpc_service ⇒ Object
readonly
legacy_grpc_service is built using the Ruby GRPC service implementation package and class name instead of the rpc interface representation from Protobuf.
-
#resource_name ⇒ Object
readonly
resource_name is used for the span resource name.
Instance Method Summary collapse
-
#initialize(grpc_method_object) ⇒ MethodObjectFormatter
constructor
A new instance of MethodObjectFormatter.
Constructor Details
#initialize(grpc_method_object) ⇒ MethodObjectFormatter
Returns a new instance of MethodObjectFormatter.
27 28 29 30 31 32 |
# File 'lib/datadog/tracing/contrib/grpc/formatting.rb', line 27 def initialize(grpc_method_object) @grpc_full_method = format_full_method(grpc_method_object) @resource_name = format_resource_name(grpc_method_object) @legacy_grpc_method = extract_legacy_grpc_method(grpc_method_object) @legacy_grpc_service = extract_legacy_grpc_service(grpc_method_object) 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
14 15 16 |
# File 'lib/datadog/tracing/contrib/grpc/formatting.rb', line 14 def grpc_full_method @grpc_full_method end |
#legacy_grpc_method ⇒ Object (readonly)
legacy_grpc_method is built using the Ruby GRPC service implementation method name instead of the rpc interface representation from Protobuf. It’s kept for compatibility.
22 23 24 |
# File 'lib/datadog/tracing/contrib/grpc/formatting.rb', line 22 def legacy_grpc_method @legacy_grpc_method end |
#legacy_grpc_service ⇒ Object (readonly)
legacy_grpc_service is built using the Ruby GRPC service implementation package and class name instead of the rpc interface representation from Protobuf. It’s kept for compatibility.
18 19 20 |
# File 'lib/datadog/tracing/contrib/grpc/formatting.rb', line 18 def legacy_grpc_service @legacy_grpc_service end |
#resource_name ⇒ Object (readonly)
resource_name is used for the span resource name.
25 26 27 |
# File 'lib/datadog/tracing/contrib/grpc/formatting.rb', line 25 def resource_name @resource_name end |