opensearch-project / opensearch-project/data-prepper
CloudWatch Logs as Source
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 374
- Forks
- 354
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 8
Description
Is your feature request related to a problem? Please describe.
Pipeline authors wanted to get Logs out of Amazon Cloud Watch to send to either OpenSearch or Prometheus
Describe the solution you'd like
Create a CloudWatch source plugin which retrieves logs from CloudWatch.I t should put logs into the Data Prepper in the current Metrics model, which is based on the OpenTelemetry specification.
source:
cloudwatch:
namespace: ES/OpenSearchService
log_source: logspath
dimensions:
- name: DomainName
value: my-domain
As this is a polling source, it should also allow pipeline authors to define a poll interval similar to the S3 source.
-
It also needs to have AWS configurations. These can follow similar conventions to other AWS-based plugins. This plugin should be able to handle scale and performance targeted while designing the plugin
-
Should work for Multi node and use source coordinator
-
use ACE for metrics batching framework - https://aws.amazon.com/blogs/opensource/monitor-aws-services-used-by-kubernetes-with-prometheus-and-promcat/#:~:text=YACE%E2%80%94or%20%E2%80%9CYet%20another%20CloudWatch,of%20tag%20labels%20to%20metrics
- https://github.com/nerdswords/yet-another-cloudwatch-exporter
Describe alternatives you've considered (Optional)
Additional context
https://aws.amazon.com/premiumsupport/knowledge-center/cloudwatch-logs-retrieve-data/
https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/Welcome.html
https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html
Source:
cloudwatch:
logs :
log_group_1
log_group_2
metrics :
metrics_1
metrics_1
Sample Metric Data:
Sample query - aws cloudwatch get-metric-data --cli-input-json file:///data.json
Data.json - would be like below
{
"MetricDataQueries": [
{
"Id": "myRequest",
"MetricStat": {
"Metric": {
"Namespace": "AWS/EBS",
"MetricName": "VolumeReadBytes",
"Dimensions": [
{
"Name": "VolumeId",
"Value": "vol-a"
}
]
},
"Period": 3600,
"Stat": "Average",
"Unit": "Bytes"
},
"Label": "myRequestLabel",
"ReturnData": true
}
],
"StartTime": "2023-06-01T10:40:0000",
"EndTime": "2023-06-27T14:12:0000"
}
Result-
{
"MetricDataResults": [
{
"Id": "myRequest",
"Label": "myRequestLabel",
"Timestamps": [
"2023-06-21T13:40:00+00:00",
"2023-06-21T12:40:00+00:00",
"2023-06-21T11:40:00+00:00",
"2023-06-21T10:40:00+00:00",
"2023-06-21T09:40:00+00:00",
"2023-06-21T08:40:00+00:00",
"2023-06-21T07:40:00+00:00",
"2023-06-21T06:40:00+00:00",
"2023-06-21T05:40:00+00:00",
"2023-06-21T04:40:00+00:00",
"2023-06-21T03:40:00+00:00",
"2023-06-21T02:40:00+00:00",
"2023-06-21T01:40:00+00:00"
],
"Values": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,5939.2,
341.3333333333333,
2184.5333333333333,
26785848.888888888
],
"StatusCode": "Complete"
}
],
"Messages": []
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing S3 source conventions, the source coordinator requirements, and the ACE metrics batching framework. Consult the linked CloudWatch Logs and GetMetricData APIs to define the source scope, configuration, polling, and multi-node behavior. Done means a documented CloudWatch source design with clear log and metric output requirements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, java
- Domain
- backend, cloud, observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100