-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Add aws-firehose-receiver to support collecting AWS CloudWatch metric(OpenTelemetry format) #10300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are mixing firehose and firehouse, please check which one is correct and modify the wrong ones. And the title is even firehousr
...rc/main/java/org/apache/skywalking/oap/server/receiver/aws/firehose/FirehoseHTTPHandler.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/skywalking/oap/server/receiver/otel/OtelMetricReceiverProvider.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/skywalking/oap/server/receiver/aws/firehose/FirehoseHTTPHandler.java
Outdated
Show resolved
Hide resolved
The official name should be |
|
And this is still based on the existing common http server, how do you plan to implement https for this plugin? I think you need to start an individual http server for this plugin and configure https-related things. |
This should be a separate HTTP server out of core and sharing HTTP servers. |
|
|
||
| 1. Only OpenTelemetry format is supported (refer to [Metric streams output formats](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html)) | ||
| 2. Doesn't support HTTP Headers - Content-Encoding | ||
| 3. Only HTTPS could be accepted, you could directly enable TSL and set the receiver to listen 443, or put the receiver behind a gateway with HTTPS (refer to [Amazon Kinesis Data Firehose Delivery Stream HTTP Endpoint Delivery Specifications](https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 443 or 13800 expected to set? I found inconsistent in the doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default port is 13800. But if users want to directly use the receiver, they have to set the port to 443, because of require of AWS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If AWS requires this, we should set 443 by default. As the HTTP server is off by OAP, we should be good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
443 requires root privilege, It will force the user to run OAP by root. So I choose another port as default and introduce that the port could be modified in the doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does AWS support use custom port? This only makes sense if aws did.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does AWS support use custom port? This only makes sense if aws did.
It makes sense when users run OAP behind a gateway. In my opinion it makes no sense to expose port 443 (https port) from OAP, it's hardly possible in reality. I'm still in doubt whether this is useful and practical in reality as they said Currently, only port 443 is supported for HTTP endpoint data delivery.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we need a gateway, we should document it. But the reason is the key.
In this thread, two things we need to make sure.
- 443 is required or just default
- whether a gatway is recommended, and why.
...rc/main/java/org/apache/skywalking/oap/server/receiver/aws/firehose/FirehoseHTTPHandler.java
Outdated
Show resolved
Hide resolved
...rg/apache/skywalking/oap/server/receiver/aws/firehose/AWSFirehoseReceiverModuleProvider.java
Show resolved
Hide resolved
...org/apache/skywalking/oap/server/receiver/otel/otlp/OpenTelemetryMetricRequestProcessor.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/skywalking/oap/server/receiver/aws/firehose/FirehoseHTTPHandler.java
Outdated
Show resolved
Hide resolved
It seems armeria zipkin client defines |
|
Why suddenly are we talking about Zipkin? |
|
Because I added 4c1df86#diff-b034fcbcccfb37d631c81c5c140b518d5b708a395cfa0b24162f492ddb749ddbR76 |
|
I think we don't need to change the default behavior. |
Please note that Zipkin receiver decodes the content by itself, if you add a decoding service decorator to the http server, you should remove the one in Zipkin receiver, otherwise the content is decoded twice, which is obviously wrong. I think it's good to add the decoding service to the http server by default, normally an http server should take care of the encoding of the content according to the header out of box. @pg-yang a patch can be applied directly (click to expand):diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/http/HTTPServer.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/http/HTTPServer.java
index 673163a6b1..67de3c2ca0 100644
--- a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/http/HTTPServer.java
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/http/HTTPServer.java
@@ -72,10 +72,9 @@ public class HTTPServer implements Server {
return HttpResponse.of(HttpStatus.METHOD_NOT_ALLOWED);
}
return delegate.serve(ctx, req);
- }).decorator(LoggingService.newDecorator());
- if (config.isEnableContentEncoding()) {
- sb.decorator(DecodingService.newDecorator());
- }
+ })
+ .decorator(DecodingService.newDecorator())
+ .decorator(LoggingService.newDecorator());
if (config.isEnableTLS()) {
sb.https(new InetSocketAddress(
config.getHost(),
diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/http/HTTPServerConfig.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/http/HTTPServerConfig.java
index 1693cb71a5..9d9daa1356 100644
--- a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/http/HTTPServerConfig.java
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/http/HTTPServerConfig.java
@@ -45,8 +45,4 @@ public class HTTPServerConfig {
private String tlsKeyPath;
private String tlsCertChainPath;
-
- @Builder.Default
- private boolean enableContentEncoding = false;
-
}
diff --git a/oap-server/server-receiver-plugin/zipkin-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/zipkin/handler/UnzippingBytesRequestConverter.java b/oap-server/server-receiver-plugin/zipkin-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/zipkin/handler/UnzippingBytesRequestConverter.java
deleted file mode 100644
index 412ccac7d3..0000000000
--- a/oap-server/server-receiver-plugin/zipkin-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/zipkin/handler/UnzippingBytesRequestConverter.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.oap.server.receiver.zipkin.handler;
-
-import com.linecorp.armeria.common.AggregatedHttpRequest;
-import com.linecorp.armeria.common.HttpData;
-import com.linecorp.armeria.common.HttpHeaderNames;
-import com.linecorp.armeria.common.encoding.StreamDecoderFactory;
-import com.linecorp.armeria.server.ServiceRequestContext;
-
-final class UnzippingBytesRequestConverter {
-
- static HttpData convertRequest(ServiceRequestContext ctx, AggregatedHttpRequest request) {
- String encoding = request.headers().get(HttpHeaderNames.CONTENT_ENCODING);
- HttpData content = request.content();
- if (!content.isEmpty() && encoding != null && encoding.contains("gzip")) {
- content = StreamDecoderFactory.gzip().newDecoder(ctx.alloc()).decode(content);
- if (content.isEmpty()) {
- content.close();
- throw new IllegalArgumentException("Cannot unzip request content bytes");
- }
- }
- return content;
- }
-}
diff --git a/oap-server/server-receiver-plugin/zipkin-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/zipkin/handler/ZipkinSpanHTTPHandler.java b/oap-server/server-receiver-plugin/zipkin-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/zipkin/handler/ZipkinSpanHTTPHandler.java
index 2acaa9d848..ea5cadcf12 100644
--- a/oap-server/server-receiver-plugin/zipkin-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/zipkin/handler/ZipkinSpanHTTPHandler.java
+++ b/oap-server/server-receiver-plugin/zipkin-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/zipkin/handler/ZipkinSpanHTTPHandler.java
@@ -100,7 +100,7 @@ public class ZipkinSpanHTTPHandler {
final HttpRequest req) {
final HistogramMetrics.Timer timer = histogram.createTimer();
final HttpResponse response = HttpResponse.from(req.aggregate().thenApply(request -> {
- try (final HttpData httpData = UnzippingBytesRequestConverter.convertRequest(ctx, request)) {
+ try (final HttpData httpData = request.content()) {
final List<Span> spanList = decoder.decodeList(httpData.byteBuf().nioBuffer());
spanForward.send(spanList);
return HttpResponse.of(HttpStatus.OK);
|
...src/main/java/org/apache/skywalking/oap/server/receiver/otel/OtelMetricReceiverProvider.java
Outdated
Show resolved
Hide resolved
...rg/apache/skywalking/oap/server/receiver/aws/firehose/AWSFirehoseReceiverModuleProvider.java
Show resolved
Hide resolved
…(OpenTelemetry format)
wu-sheng
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally good for this version. Pend on @kezhenxu94 to check details.
Co-authored-by: kezhenxu94 <kezhenxu94@apache.org>
Co-authored-by: kezhenxu94 <kezhenxu94@apache.org>
CHANGESlog.Related issue : #9883