Skip to content

Commit b991cfd

Browse files
authored
Polish aws-firehose-receiver to adapt existing OTEL proto (apache#10343)
1 parent b8e4a02 commit b991cfd

File tree

17 files changed

+2161
-4
lines changed

17 files changed

+2161
-4
lines changed

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ The text of each license is the standard Apache 2.0 license.
220220
proto files from opencensus: https://github.com/census-instrumentation/opencensus-proto/tree/master/gen-go Apache 2.0
221221
proto files from prometheus/client_model: https://github.com/prometheus/client_model Apache 2.0
222222
proto files from opentelemetry: https://github.com/open-telemetry/opentelemetry-proto/tree/main/opentelemetry/proto Apache 2.0
223+
proto files from opentelemetry: https://github.com/open-telemetry/opentelemetry-proto/tree/v0.7.0 Apache 2.0
223224
flatbuffers files from istio/proxy: https://github.com/istio/proxy Apache 2.0
224225
mvnw files from https://github.com/apache/maven-wrapper Apache 2.0
225226
svg files from skywalking-ui/src/assets/icons: https://github.com/google/material-design-icons Apache 2.0

docs/en/setup/backend/aws-firehose-receiver.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ You could leverage the receiver to collect [AWS CloudWatch metrics](https://docs
55

66
## Setup(S3 example)
77

8-
1. Create CloudWatch metrics configuration for S3 (refer to [S3 CloudWatch metrics](https://docs.aws.amazon.com/AmazonS3/latest/userguide/configure-request-metrics-bucket.html))
8+
1. Create CloudWatch metrics configuration for S3 (refer to [S3 CloudWatch metrics](https://docs.aws.amazon.com/AmazonS3/latest/userguide/configure-request-metrics-bucket.html))
99
2. Stream CloudWatch metrics to AWS Kinesis Data Firehose delivery stream by [CloudWatch metrics stream](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-setup-datalake.html)
1010
3. Specify AWS Kinesis Data Firehose delivery stream HTTP Endpoint (refer to [Choose HTTP Endpoint for Your Destination](https://docs.aws.amazon.com/firehose/latest/dev/create-destination.html#create-destination-http))
1111

oap-server/server-receiver-plugin/aws-firehose-receiver/pom.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,35 @@
3838
<version>${project.version}</version>
3939
</dependency>
4040
</dependencies>
41+
42+
<build>
43+
<plugins>
44+
<plugin>
45+
<groupId>org.xolstice.maven.plugins</groupId>
46+
<artifactId>protobuf-maven-plugin</artifactId>
47+
<version>${protobuf-maven-plugin.version}</version>
48+
<configuration>
49+
<!--
50+
The version of protoc must match protobuf-java. If you don't depend on
51+
protobuf-java directly, you will be transitively depending on the
52+
protobuf-java version that grpc depends on.
53+
-->
54+
<protocArtifact>com.google.protobuf:protoc:3.19.2:exe:${os.detected.classifier}
55+
</protocArtifact>
56+
<pluginId>grpc-java</pluginId>
57+
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.42.1:exe:${os.detected.classifier}
58+
</pluginArtifact>
59+
</configuration>
60+
<executions>
61+
<execution>
62+
<goals>
63+
<goal>compile</goal>
64+
<goal>compile-custom</goal>
65+
</goals>
66+
</execution>
67+
</executions>
68+
</plugin>
69+
</plugins>
70+
</build>
71+
4172
</project>

oap-server/server-receiver-plugin/aws-firehose-receiver/src/main/java/org/apache/skywalking/oap/server/receiver/aws/firehose/FirehoseHTTPHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import com.linecorp.armeria.server.annotation.ConsumesJson;
2424
import com.linecorp.armeria.server.annotation.Post;
2525
import com.linecorp.armeria.server.annotation.ProducesJson;
26-
import io.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;
26+
import io.opentelemetry.proto.collector.metrics.firehose.v0_7.ExportMetricsServiceRequest;
2727
import java.io.ByteArrayInputStream;
2828
import java.util.Base64;
2929
import lombok.AllArgsConstructor;
@@ -33,7 +33,6 @@
3333
@Slf4j
3434
@AllArgsConstructor
3535
public class FirehoseHTTPHandler {
36-
3736
private final OpenTelemetryMetricRequestProcessor openTelemetryMetricRequestProcessor;
3837

3938
@Post("/aws/firehose/metrics")
@@ -46,7 +45,8 @@ public HttpResponse collectMetrics(final FirehoseReq firehoseReq) {
4645
Base64.getDecoder().decode(record.getData()));
4746
ExportMetricsServiceRequest request;
4847
while ((request = ExportMetricsServiceRequest.parseDelimitedFrom(byteArrayInputStream)) != null) {
49-
openTelemetryMetricRequestProcessor.processMetricsRequest(request);
48+
openTelemetryMetricRequestProcessor.processMetricsRequest(
49+
OtelMetricsConvertor.convertExportMetricsRequest(request));
5050
}
5151
}
5252
} catch (InvalidProtocolBufferException e) {

0 commit comments

Comments
 (0)