Skip to content
This repository was archived by the owner on Mar 15, 2021. It is now read-only.

Commit e62faa2

Browse files
author
William Huba
authored
Iterate batch points for OpenTelemetry output (#244)
1 parent 431cbfb commit e62faa2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/opentelemetry/src/main/java/com/spotify/ffwd/opentelemetry/OpenTelemetryPluginSink.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.spotify.ffwd.model.v2.Batch;
2525
import com.spotify.ffwd.model.v2.Metric;
2626
import com.spotify.ffwd.output.PluginSink;
27+
import com.spotify.ffwd.util.BatchMetricConverter;
2728
import eu.toolchain.async.AsyncFramework;
2829
import eu.toolchain.async.AsyncFuture;
2930
import io.grpc.ManagedChannel;
@@ -106,7 +107,10 @@ public void sendMetric(Metric metric) {
106107

107108
@Override
108109
public void sendBatch(Batch batch) {
109-
throw new RuntimeException("Batches are unsupported");
110+
// TODO(hexedpackets): The batch point iteration is temporary.
111+
// Multiple metrics can be more efficiently sent in a single protobuf
112+
batch.getPoints().forEach(point ->
113+
sendMetric(BatchMetricConverter.convertBatchMetric(batch, point)));
110114
}
111115

112116
@Override

0 commit comments

Comments
 (0)