From 6884ded21d95596a2c3dca1ad88caa9ad742082f Mon Sep 17 00:00:00 2001 From: Lewis Robbins Date: Sun, 12 Feb 2023 00:30:59 +0000 Subject: [PATCH] Feat(awscloudwatchmetricsreceiver): Initial commit --- .../awscloudwatchmetricsreceiver/Makefile | 1 + .../awscloudwatchmetricsreceiver/README.md | 62 +++++++++++++++++++ .../awscloudwatchmetricsreceiver/config.go | 0 .../config_test.go | 0 receiver/awscloudwatchmetricsreceiver/docs.go | 0 .../awscloudwatchmetricsreceiver/factory.go | 0 .../awscloudwatchmetricsreceiver/receiver.go | 0 7 files changed, 63 insertions(+) create mode 100644 receiver/awscloudwatchmetricsreceiver/Makefile create mode 100644 receiver/awscloudwatchmetricsreceiver/README.md create mode 100644 receiver/awscloudwatchmetricsreceiver/config.go create mode 100644 receiver/awscloudwatchmetricsreceiver/config_test.go create mode 100644 receiver/awscloudwatchmetricsreceiver/docs.go create mode 100644 receiver/awscloudwatchmetricsreceiver/factory.go create mode 100644 receiver/awscloudwatchmetricsreceiver/receiver.go diff --git a/receiver/awscloudwatchmetricsreceiver/Makefile b/receiver/awscloudwatchmetricsreceiver/Makefile new file mode 100644 index 000000000000..ded7a36092dc --- /dev/null +++ b/receiver/awscloudwatchmetricsreceiver/Makefile @@ -0,0 +1 @@ +include ../../Makefile.Common diff --git a/receiver/awscloudwatchmetricsreceiver/README.md b/receiver/awscloudwatchmetricsreceiver/README.md new file mode 100644 index 000000000000..c974806348d0 --- /dev/null +++ b/receiver/awscloudwatchmetricsreceiver/README.md @@ -0,0 +1,62 @@ +# CloudWatch Metrics Receiver + +| Status | | +| ------------------------ | ------------- | +| Stability | [development] | +| Supported pipeline types | metrics | +| Distributions | [contrib] | + +Receives Cloudwatch metrics from [AWS Cloudwatch](https://aws.amazon.com/cloudwatch/) via the [AWS SDK for Cloudwatch Logs](https://docs.aws.amazon.com/sdk-for-go/api/service/cloudwatchlogs/) + +## Getting Started + +This receiver uses the [AWS SDK](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html) as mode of authentication, which includes [Profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) and [IMDS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) authentication for EC2 instances. + +## Configuration + +### Top Level Parameters + +| Parameter | Notes | type | Description | +| --------------- | ---------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `region` | *required* | string | The AWS recognized region string | +| `profile` | *optional* | string | The AWS profile used to authenticate, if none is specified the default is chosen from the list of profiles | +| `imds_endpoint` | *optional* | string | A way of specifying a custom URL to be used by the EC2 IMDS client to validate the session. If unset, and the environment variable `AWS_EC2_METADATA_SERVICE_ENDPOINT` has a value the client will use the value of the environment variable as the endpoint for operation calls. | +| `metrics` | *optional* | `Metrics` | Configuration for metrics ingestion of this receiver | + +### Metrics Parameters + +| Parameter | Notes | type | Description | +| ------------------------ | ------------ | ---------------------- | ------------------------------------------------------------------------------------------ | +| `poll_interval` | `default=1m` | duration | The duration waiting in between requests. | +| `max_events_per_request` | `default=50` | int | The maximum number of events to process per request to Cloudwatch | +| `groups` | *optional* | `See Group Parameters` | Configuration for Log Groups, by default all Log Groups and Log Streams will be collected. | + +### Group Parameters + +`named` is the way to control and filter which metrics collected . They are mutually exclusive and are incompatible to be configured at the same time. + +- `named` + - This is a map of log group name to stream filtering options + - `namespace`: (optional) + - `metric_names`: A list of full log stream names to filter the discovered log groups to collect from. + - `metric_name_prefixes`: A list of prefixes to filter the discovered log groups to collect from. + + +#### Named Example + +```yaml +awscloudwatchmetrics: + region: us-west-1 + poll_interval: 5m + metrics: + named: + - namespace: /aws/eks/dev-0/cluster: + metric_names: [kube-apiserver-ea9c831555adca1815ae04b87661klasdj] +``` + +## Sample Configs + + +[alpha]:https://github.com/open-telemetry/opentelemetry-collector#alpha +[contrib]:https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib +[Issue]:https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/15667 diff --git a/receiver/awscloudwatchmetricsreceiver/config.go b/receiver/awscloudwatchmetricsreceiver/config.go new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/receiver/awscloudwatchmetricsreceiver/config_test.go b/receiver/awscloudwatchmetricsreceiver/config_test.go new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/receiver/awscloudwatchmetricsreceiver/docs.go b/receiver/awscloudwatchmetricsreceiver/docs.go new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/receiver/awscloudwatchmetricsreceiver/factory.go b/receiver/awscloudwatchmetricsreceiver/factory.go new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/receiver/awscloudwatchmetricsreceiver/receiver.go b/receiver/awscloudwatchmetricsreceiver/receiver.go new file mode 100644 index 000000000000..e69de29bb2d1