Class: Fluent::Plugin::Opentelemetry::Request::Logs
- Inherits:
-
Object
- Object
- Fluent::Plugin::Opentelemetry::Request::Logs
- Defined in:
- lib/fluent/plugin/opentelemetry/request.rb
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(body, ignore_unknown_fields: true) ⇒ Logs
constructor
A new instance of Logs.
- #record ⇒ Object
Constructor Details
#initialize(body, ignore_unknown_fields: true) ⇒ Logs
Returns a new instance of Logs.
12 13 14 15 16 17 18 19 |
# File 'lib/fluent/plugin/opentelemetry/request.rb', line 12 def initialize(body, ignore_unknown_fields: true) @request = if body.start_with?("{") Opentelemetry::Proto::Collector::Logs::V1::ExportLogsServiceRequest.decode_json(body, ignore_unknown_fields: ignore_unknown_fields) else Opentelemetry::Proto::Collector::Logs::V1::ExportLogsServiceRequest.decode(body) end end |
Instance Method Details
#body ⇒ Object
21 22 23 |
# File 'lib/fluent/plugin/opentelemetry/request.rb', line 21 def body @request.to_proto end |
#record ⇒ Object
25 26 27 |
# File 'lib/fluent/plugin/opentelemetry/request.rb', line 25 def record @request.to_json end |