Class: Fluent::Plugin::Opentelemetry::Request::Traces
- Inherits:
-
Object
- Object
- Fluent::Plugin::Opentelemetry::Request::Traces
- Defined in:
- lib/fluent/plugin/opentelemetry/request.rb
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(body, ignore_unknown_fields: true) ⇒ Traces
constructor
A new instance of Traces.
- #record ⇒ Object
Constructor Details
#initialize(body, ignore_unknown_fields: true) ⇒ Traces
Returns a new instance of Traces.
50 51 52 53 54 55 56 57 |
# File 'lib/fluent/plugin/opentelemetry/request.rb', line 50 def initialize(body, ignore_unknown_fields: true) @request = if body.start_with?("{") Opentelemetry::Proto::Collector::Trace::V1::ExportTraceServiceRequest.decode_json(body, ignore_unknown_fields: ignore_unknown_fields) else Opentelemetry::Proto::Collector::Trace::V1::ExportTraceServiceRequest.decode(body) end end |
Instance Method Details
#body ⇒ Object
59 60 61 |
# File 'lib/fluent/plugin/opentelemetry/request.rb', line 59 def body @request.to_proto end |
#record ⇒ Object
63 64 65 |
# File 'lib/fluent/plugin/opentelemetry/request.rb', line 63 def record @request.to_json end |