This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
The following commit(s) were added to refs/heads/main by this push:
new f9a150b Add AWS CloudWatch Kamelet
f9a150b is described below
commit f9a150b669e170868aa8147fe6c61581c245b8c3
Author: Claudio Miranda <[email protected]>
AuthorDate: Thu Apr 8 11:06:52 2021 -0300
Add AWS CloudWatch Kamelet
---
aws-cloudwatch-sink.kamelet.yaml | 131 +++++++++++++++++++++
.../assets/images/kamelets/aws-cloudwatch-sink.svg | 1 +
docs/modules/ROOT/nav.adoc | 2 +-
docs/modules/ROOT/pages/aws-cloudwatch-sink.adoc | 77 ++++++++++++
4 files changed, 210 insertions(+), 1 deletion(-)
diff --git a/aws-cloudwatch-sink.kamelet.yaml b/aws-cloudwatch-sink.kamelet.yaml
new file mode 100644
index 0000000..72fc32b
--- /dev/null
+++ b/aws-cloudwatch-sink.kamelet.yaml
@@ -0,0 +1,131 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+ name: aws-cloudwatch-sink
+ annotations:
+ camel.apache.org/kamelet.support.level: "Preview"
+ camel.apache.org/catalog.version: "main-SNAPSHOT"
+ camel.apache.org/kamelet.icon:
"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIwNyIgaGVpZ2h0PSIyNTAwIiB2aWV3Qm94PSIwIDAgMjU2IDI5MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCI+PHBhdGggZD0iTTI1NiAxOTkuMzA1bC0xMjcuOTU3LTE4Ljc5N0wwIDE5OS4zMjlsMTI4LjAxIDQ3LjQzOUwyNTYgMTk5LjMwNSIgZmlsbD0iI0I3Q0E5RCIvPjxwYXRoIGQ9Ik0yNS42MjEgMTk3LjExM2wyMS42MyA2Ljc2MSAxLjk3MS0yLjIzOFY1MC4yODRsLTEuOTcxLTIuNTg1LTIxLjYzIDguMjc0djE0MS4xNCIgZmlsbD0iIzRCNjEyQyIvPjxwYXRoIG
[...]
+ camel.apache.org/provider: "Apache Software Foundation"
+ camel.apache.org/kamelet.group: "AWS Cloudwatch"
+ labels:
+ camel.apache.org/kamelet.type: "sink"
+spec:
+ definition:
+ title: "AWS CloudWatch Metrics Sink"
+ description: |-
+ Send messages to AWS CloudWatch metrics.
+
+ There are several properties you can set in the headers, such as:
+
+ `metric-name` / `ce-metric-name` for the metric name.
+ `metric-value` / `ce-metric-value` for the metric value.
+ `metric-unit` / `ce-metric-unit` for the metric unit.
+ `metric-timestamp` / `ce-metric-timestamp` for the metric timestamp.
+ `metric-dimension-name` / `ce-metric-dimension-name` for the dimension
name.
+ `metric-dimension-value` / `ce-metric-dimension-value` for the dimension
value.
+ required:
+ - cw_namespace
+ - accessKey
+ - secretKey
+ - region
+ type: object
+ properties:
+ cw_namespace:
+ title: Cloud Watch Namespace
+ description: The cloud watch metric namespace.
+ type: string
+ accessKey:
+ title: Access Key
+ description: The access key obtained from AWS.
+ type: string
+ format: password
+ x-descriptors:
+ - urn:alm:descriptor:com.tectonic.ui:password
+ secretKey:
+ title: Secret Key
+ description: The secret key obtained from AWS.
+ type: string
+ format: password
+ x-descriptors:
+ - urn:alm:descriptor:com.tectonic.ui:password
+ region:
+ title: AWS Region
+ description: The AWS region to connect to.
+ type: string
+ example: eu-west-1
+ dependencies:
+ - "camel:aws2-cw"
+ - "camel:kamelet"
+ flow:
+ from:
+ uri: kamelet:source
+ steps:
+ - choice:
+ when:
+ - simple: "${header[metric-name]}"
+ steps:
+ - set-header:
+ name: CamelAwsCwMetricName
+ simple: "${header[metric-name]}"
+ - simple: "${header[ce-metric-name]}"
+ steps:
+ - set-header:
+ name: CamelAwsCwMetricName
+ simple: "${header[ce-metric-name]}"
+ - simple: "${header[metric-value]}"
+ steps:
+ - set-header:
+ name: CamelAwsCwMetricValue
+ simple: "${header[metric-value]}"
+ - simple: "${header[ce-metric-value]}"
+ steps:
+ - set-header:
+ name: CamelAwsCwMetricValue
+ simple: "${header[ce-metric-value]}"
+ - simple: "${header[metric-unit]}"
+ steps:
+ - set-header:
+ name: CamelAwsCwMetricUnit
+ simple: "${header[metric-unit]}"
+ - simple: "${header[ce-metric-unit]}"
+ steps:
+ - set-header:
+ name: CamelAwsCwMetricUnit
+ simple: "${header[ce-metric-unit]}"
+ - simple: "${header[metric-timestamp]}"
+ steps:
+ - set-header:
+ name: CamelAwsCwMetricTimestamp
+ simple: "${header[metric-timestamp]}"
+ - simple: "${header[ce-metric-timestamp]}"
+ steps:
+ - set-header:
+ name: CamelAwsCwMetricTimestamp
+ simple: "${header[ce-metric-timestamp]}"
+ - simple: "${header[metric-dimension-name]}"
+ steps:
+ - set-header:
+ name: CamelAwsCwMetricDimensionName
+ simple: "${header[metric-dimension-name]}"
+ - simple: "${header[ce-metric-dimension-name]}"
+ steps:
+ - set-header:
+ name: CamelAwsCwMetricDimensionName
+ simple: "${header[ce-metric-dimension-name]}"
+ - simple: "${header[metric-dimension-value]}"
+ steps:
+ - set-header:
+ name: CamelAwsCwMetricDimensionValue
+ simple: "${header[metric-dimension-value]}"
+ - simple: "${header[ce-metric-dimension-value]}"
+ steps:
+ - set-header:
+ name: CamelAwsCwMetricDimensionValue
+ simple: "${header[ce-metric-dimension-value]}"
+ - to:
+ uri: "aws2-cw:{{cw_namespace}}"
+ parameters:
+ secretKey: "{{secretKey}}"
+ accessKey: "{{accessKey}}"
+ region: "{{region}}"
diff --git a/docs/modules/ROOT/assets/images/kamelets/aws-cloudwatch-sink.svg
b/docs/modules/ROOT/assets/images/kamelets/aws-cloudwatch-sink.svg
new file mode 100644
index 0000000..9e245bf
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/aws-cloudwatch-sink.svg
@@ -0,0 +1 @@
+<svg width="2207" height="2500" viewBox="0 0 256 290"
xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid"><path d="M256
199.305l-127.957-18.797L0 199.329l128.01 47.439L256 199.305"
fill="#B7CA9D"/><path d="M25.621 197.113l21.63 6.761
1.971-2.238V50.284l-1.971-2.585-21.63 8.274v141.14" fill="#4B612C"/><path
d="M123.832 190.423l-76.581 13.451V47.703l76.581 17.222v125.498"
fill="#759C3E"/><path d="M89.686 216.889l-29.848-9.201V14.928L89.686.004l2.612
2.845v210.858l-2.612 3.182 [...]
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index db3a69b..d0e4349 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -1,6 +1,6 @@
-// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
*
xref:ROOT:avro-deserialize-action.adoc[image:kamelets/avro-deserialize-action.svg[]
Avro Deserialize Action]
*
xref:ROOT:avro-serialize-action.adoc[image:kamelets/avro-serialize-action.svg[]
Avro Serialize Action]
+* xref:ROOT:aws-cloudwatch-sink.adoc[image:kamelets/aws-cloudwatch-sink.svg[]
AWS CloudWatch Metrics Sink]
*
xref:ROOT:aws-ddb-streams-source.adoc[image:kamelets/aws-ddb-streams-source.svg[]
AWS DynamoDB Streams Source]
*
xref:ROOT:aws-kinesis-firehose-sink.adoc[image:kamelets/aws-kinesis-firehose-sink.svg[]
AWS Kinesis Firehose Sink]
* xref:ROOT:aws-kinesis-sink.adoc[image:kamelets/aws-kinesis-sink.svg[] AWS
Kinesis Sink]
diff --git a/docs/modules/ROOT/pages/aws-cloudwatch-sink.adoc
b/docs/modules/ROOT/pages/aws-cloudwatch-sink.adoc
new file mode 100644
index 0000000..33f3b4e
--- /dev/null
+++ b/docs/modules/ROOT/pages/aws-cloudwatch-sink.adoc
@@ -0,0 +1,77 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+= image:kamelets/aws-cloudwatch-sink.svg[] AWS CloudWatch Metrics Sink
+
+*Provided by: "Apache Software Foundation"*
+
+*Support Level for this Kamelet is: "Preview"*
+
+Send messages to AWS CloudWatch metrics.
+
+There are several properties you can set in the headers, such as:
+
+`metric-name` / `ce-metric-name` for the metric name.
+`metric-value` / `ce-metric-value` for the metric value.
+`metric-unit` / `ce-metric-unit` for the metric unit.
+`metric-timestamp` / `ce-metric-timestamp` for the metric timestamp.
+`metric-dimension-name` / `ce-metric-dimension-name` for the dimension name.
+`metric-dimension-value` / `ce-metric-dimension-value` for the dimension value.
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the
`aws-cloudwatch-sink` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *accessKey {empty}* *| Access Key| The access key obtained from AWS.|
string| |
+| *cw_namespace {empty}* *| Cloud Watch Namespace| The cloud watch metric
namespace.| string| |
+| *region {empty}* *| AWS Region| The AWS region to connect to.| string| |
`"eu-west-1"`
+| *secretKey {empty}* *| Secret Key| The secret key obtained from AWS.|
string| |
+|===
+
+NOTE: Fields marked with ({empty}*) are mandatory.
+
+== Usage
+
+This section summarizes how the `aws-cloudwatch-sink` can be used in various
contexts.
+
+=== Knative Sink
+
+The `aws-cloudwatch-sink` Kamelet can be used as Knative sink by binding it to
a Knative object.
+
+.aws-cloudwatch-sink-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+ name: aws-cloudwatch-sink-binding
+spec:
+ source:
+ ref:
+ kind: InMemoryChannel
+ apiVersion: messaging.knative.dev/v1
+ name: mychannel
+ sink:
+ ref:
+ kind: Kamelet
+ apiVersion: camel.apache.org/v1alpha1
+ name: aws-cloudwatch-sink
+ properties:
+ accessKey: "The Access Key"
+ cw_namespace: "The Cloud Watch Namespace"
+ region: "eu-west-1"
+ secretKey: "The Secret Key"
+
+----
+
+Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K
installed] into the Kubernetes cluster you're connected to.
+
+Save the `aws-cloudwatch-sink-binding.yaml` file into your hard drive, then
configure it according to your needs.
+
+You can run the sink using the following command:
+
+[source,shell]
+----
+kubectl apply -f aws-cloudwatch-sink-binding.yaml
+----
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT