File tree 3 files changed +12
-12
lines changed 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ def initialize(body)
18
18
end
19
19
end
20
20
21
- def encode
22
- Opentelemetry :: Proto :: Collector :: Logs :: V1 :: ExportLogsServiceRequest . encode ( @request )
21
+ def body
22
+ @request . class . encode ( @request )
23
23
end
24
24
25
25
def record
@@ -37,8 +37,8 @@ def initialize(body)
37
37
end
38
38
end
39
39
40
- def encode
41
- Opentelemetry :: Proto :: Collector :: Metrics :: V1 :: ExportMetricsServiceRequest . encode ( @request )
40
+ def body
41
+ @request . class . encode ( @request )
42
42
end
43
43
44
44
def record
@@ -56,8 +56,8 @@ def initialize(body)
56
56
end
57
57
end
58
58
59
- def encode
60
- Opentelemetry :: Proto :: Collector :: Trace :: V1 :: ExportTraceServiceRequest . encode ( @request )
59
+ def body
60
+ @request . class . encode ( @request )
61
61
end
62
62
63
63
def record
Original file line number Diff line number Diff line change @@ -132,13 +132,13 @@ def create_http_connection(chunk)
132
132
case record [ "type" ]
133
133
when Otlp ::RECORD_TYPE_LOGS
134
134
uri = http_logs_endpoint
135
- body = Otlp ::Request ::Logs . new ( msg ) . encode
135
+ body = Otlp ::Request ::Logs . new ( msg ) . body
136
136
when Otlp ::RECORD_TYPE_METRICS
137
137
uri = http_metrics_endpoint
138
- body = Otlp ::Request ::Metrics . new ( msg ) . encode
138
+ body = Otlp ::Request ::Metrics . new ( msg ) . body
139
139
when Otlp ::RECORD_TYPE_TRACES
140
140
uri = http_traces_endpoint
141
- body = Otlp ::Request ::Traces . new ( msg ) . encode
141
+ body = Otlp ::Request ::Traces . new ( msg ) . body
142
142
end
143
143
rescue Google ::Protobuf ::ParseError => e
144
144
# The message format does not comply with the OpenTelemetry protocol.
Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ module JSON
26
26
end
27
27
28
28
module ProtocolBuffers
29
- METRICS = Fluent ::Plugin ::Otlp ::Request ::Metrics . new ( TestData ::JSON ::METRICS ) . encode
30
- TRACES = Fluent ::Plugin ::Otlp ::Request ::Traces . new ( TestData ::JSON ::TRACES ) . encode
31
- LOGS = Fluent ::Plugin ::Otlp ::Request ::Logs . new ( TestData ::JSON ::LOGS ) . encode
29
+ METRICS = Fluent ::Plugin ::Otlp ::Request ::Metrics . new ( TestData ::JSON ::METRICS ) . body
30
+ TRACES = Fluent ::Plugin ::Otlp ::Request ::Traces . new ( TestData ::JSON ::TRACES ) . body
31
+ LOGS = Fluent ::Plugin ::Otlp ::Request ::Logs . new ( TestData ::JSON ::LOGS ) . body
32
32
33
33
INVALID = "invalid"
34
34
end
You can’t perform that action at this time.
0 commit comments