Class: Fluent::Plugin::Opentelemetry::Response::Metrics
- Inherits:
-
Object
- Object
- Fluent::Plugin::Opentelemetry::Response::Metrics
- Defined in:
- lib/fluent/plugin/opentelemetry/response.rb
Class Method Summary collapse
Instance Method Summary collapse
- #body(type:) ⇒ Object
-
#initialize(rejected: 0, error: "") ⇒ Metrics
constructor
A new instance of Metrics.
Constructor Details
Class Method Details
.build(rejected: 0, error: "") ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/fluent/plugin/opentelemetry/response.rb', line 46 def self.build(rejected: 0, error: "") Opentelemetry::Proto::Collector::Metrics::V1::ExportMetricsServiceResponse.new( partial_success: Opentelemetry::Proto::Collector::Metrics::V1::ExportMetricsPartialSuccess.new( rejected_data_points: rejected, error_message: error ) ) end |
Instance Method Details
#body(type:) ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/fluent/plugin/opentelemetry/response.rb', line 59 def body(type:) if type == :protobuf @response.to_proto else @response.to_json end end |