You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/04/09 09:41:40 UTC

[GitHub] [camel-kamelets] nicolaferraro commented on a change in pull request #123: Add AWS CloudWatch Kamelet

nicolaferraro commented on a change in pull request #123:
URL: https://github.com/apache/camel-kamelets/pull/123#discussion_r610491652



##########
File path: aws-cloudwatch-sink.kamelet.yaml
##########
@@ -0,0 +1,86 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: aws-cloudwatch-sink
+  annotations:
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIwNyIgaGVpZ2h0PSIyNTAwIiB2aWV3Qm94PSIwIDAgMjU2IDI5MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCI+PHBhdGggZD0iTTI1NiAxOTkuMzA1bC0xMjcuOTU3LTE4Ljc5N0wwIDE5OS4zMjlsMTI4LjAxIDQ3LjQzOUwyNTYgMTk5LjMwNSIgZmlsbD0iI0I3Q0E5RCIvPjxwYXRoIGQ9Ik0yNS42MjEgMTk3LjExM2wyMS42MyA2Ljc2MSAxLjk3MS0yLjIzOFY1MC4yODRsLTEuOTcxLTIuNTg1LTIxLjYzIDguMjc0djE0MS4xNCIgZmlsbD0iIzRCNjEyQyIvPjxwYXRoIGQ9Ik0xMjMuODMyIDE5MC40MjNsLTc2LjU4MSAxMy40NTFWNDcuNzAzbDc2LjU4MSAxNy4yMjJ2MTI1LjQ5OCIgZmlsbD0iIzc1OUMzRSIvPjxwYXRoIGQ9Ik04OS42ODYgMjE2Ljg4OWwtMjkuODQ4LTkuMjAxVjE0LjkyOEw4OS42ODYuMDA0bDIuNjEyIDIuODQ1djIxMC44NThsLTIuNjEyIDMuMTgyIiBmaWxsPSIjNEI2MTJDIi8+PHBhdGggZD0iTTE5MS45NjcgMTkyLjg5NEw4OS42ODYgMjE2Ljg4OVYwbDEwMi4yODEgMzkuODY2djE1My4wMjgiIGZpbGw9IiM3NTlDM0UiLz48cGF0aCBkPSJNMTI3Ljk2NSAyNDQuNzE0TDAgMTk5LjMyOXYyNi4zMjRsMTI3Ljk2NSA2My45ODN2LTQ0LjkyMiIgZmlsbD0iIzRCNjEyQyIvPjxwYXRoIGQ9Ik0yNTYgMjI1LjYyMmwtMTI
 4LjAzNSA2NC4wMTR2LTQ0LjkyMkwyNTYgMTk5LjMwNXYyNi4zMTciIGZpbGw9IiM3NTlDM0UiLz48cGF0aCBkPSJNMjIwLjAzOSAxNTUuNjkyaC0zMS4wMjZsLTg4LjQ0NSA2LjAyNkwxMjggMTY2Ljc3NWw5Mi4wMzktMTEuMDgzIiBmaWxsPSIjQjdDQTlEIi8+PHBhdGggZD0iTTEwMC41NjggMjE5LjkwNmwyNy40MiA4LjIyNi43ODktLjg0OS0uMDIzLTYxLjg0OS0uNzg5LS43NTgtMjcuMzk3LTIuOTU4djU4LjE4OCIgZmlsbD0iIzRCNjEyQyIvPjxwYXRoIGQ9Ik0yMjAuMDM5IDE1NS42OTJsLTkyLjA3NCA4Ljk4LjAyMyA2My40NiA5Mi4wNTEtMjcuNzExdi00NC43MjkiIGZpbGw9IiM3NTlDM0UiLz48L3N2Zz4K"
+    camel.apache.org/provider: "Apache Software Foundation"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "AWS CloudWatch Metrics Sink"
+    description: |-
+      Send messages to AWS CloudWatch metrics.
+
+      You can set the Dimensions in the header, by using CamelAwsCwMetricDimensionName for the dimension name 
+      and CamelAwsCwMetricDimensionValue for the dimension value.
+
+      Most of the property values can be defined in headers, overwriting any parameter previously defined:
+      - CamelAwsCwMetricNamespace
+      - CamelAwsCwMetricName
+      - CamelAwsCwMetricValue
+      - CamelAwsCwMetricUnit
+      - CamelAwsCwMetricTimestamp
+      - CamelAwsCwMetricDimensionName
+      - CamelAwsCwMetricDimensionValue

Review comment:
       As general rule, we don't use Camel* headers in Kamelets, since these are higher level objects that hide their Camel engine. Usually we have a few headers, but here we have many more of them, so the mapping may be verbose, since e.g. we may need to detect both e.g. `metric-namespace` and `ce-metric-namespace` headers.
   
   One reason is that we want to hide camel, the other is that in some contexts, e.g. knative, you are able to only send cloud-event extensions, which are mapped to headers that start with the "ce-" prefix.
   
   A different issue is with the `metric-timestamp` header. Consider that (from the doc) `CamelAwsCwMetricTimestamp` needs to be a `java.util.Date`. When this sink is bound to a Knative channel or a Kafka topic, all headers are textual, so we need to define the format of the header and its conversion from text to date.
   
   Out of curiosity, is the body of the incoming message used? Maybe we should we use a structured body instead of relying on headers.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org