Skip to content

Commit

Permalink
Add aws.firehose.arn, aws.firehose.request_id and aws.metrics_names_f…
Browse files Browse the repository at this point in the history
…ingerprint fields (#11239)

This PR adds aws.firehose.arn and aws.firehose.request_id field definitions for the firehose integration.
This PR also adds aws.metrics_names_fingerprint which is a hash of the list of metric names exist in each document. This way we don't have to count request_id as a dimension.
  • Loading branch information
kaiyan-sheng authored Oct 1, 2024
1 parent 610739d commit d93fd8f
Show file tree
Hide file tree
Showing 19 changed files with 526 additions and 115 deletions.
5 changes: 5 additions & 0 deletions packages/aws_bedrock/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
- version: "0.10.0"
changes:
- description: Add aws.metrics_names_fingerprint.
type: enhancement
link: https://github.com/elastic/integrations/pull/11239
- version: "0.9.1"
changes:
- description: Update integration name to Amazon Bedrock in policy template.
Expand Down
14 changes: 11 additions & 3 deletions packages/aws_bedrock/data_stream/runtime/fields/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@
- name: bucketed_step_size
type: keyword
dimension: true
- name: aws.cloudwatch.namespace
type: keyword
description: The namespace specified when query cloudwatch api.
- name: aws
type: group
fields:
- name: cloudwatch.namespace
type: keyword
description: The namespace specified when query cloudwatch api.
- name: metrics_names_fingerprint
type: keyword
description: |
Autogenerated ID representing the fingerprint of the list of metrics names.
dimension: true
1 change: 1 addition & 0 deletions packages/aws_bedrock/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ An example event for `runtime` looks as following:
| @timestamp | Event timestamp. | date | | |
| agent.id | Unique identifier of this agent (if one exists). Example: For Beats this would be beat.id. | keyword | | |
| aws.cloudwatch.namespace | The namespace specified when query cloudwatch api. | keyword | | |
| aws.metrics_names_fingerprint | Autogenerated ID representing the fingerprint of the list of metrics names. | keyword | | |
| aws_bedrock.runtime.bucketed_step_size | | keyword | | |
| aws_bedrock.runtime.image_size | | keyword | | |
| aws_bedrock.runtime.input_token_count | The number of text input tokens. | long | | gauge |
Expand Down
2 changes: 1 addition & 1 deletion packages/aws_bedrock/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: aws_bedrock
title: Amazon Bedrock
description: Collect Amazon Bedrock model invocation logs and runtime metrics with Elastic Agent.
type: integration
version: "0.9.1"
version: "0.10.0"
categories:
- aws
conditions:
Expand Down
8 changes: 8 additions & 0 deletions packages/awsfirehose/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# newer versions go on top
- version: "1.3.0"
changes:
- description: Add aws.firehose.arn and aws.firehose.request_id fields.
type: bugfix
link: https://github.com/elastic/integrations/pull/11239
- description: Add aws.metrics_names_fingerprint to cloudwatch metrics.
type: enhancement
link: https://github.com/elastic/integrations/pull/11239
- version: "1.2.0"
changes:
- description: Add AWS Bedrock runtime metrics to Firehose rerouting.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"cloud.account.id": "12345678901",
"cloud.region": "ap-southeast-2",
"aws.exporter.arn": "arn:aws:cloudwatch:ap-southeast-2:12345678901:metric-stream/test-firehose-metrics",
"aws.firehose.arn": "arn:aws:firehose:ap-southeast-2:12345678901:deliverystream/KS-PUT-ELI-2",
"aws.firehose.parameters.X-Found-Cluster": "bb8e51259abe4c21996954f5cfe90af1",
"aws.firehose.request_id": "adcedd1d-00d2-4499-a917-4fba68f55427",
"aws.cloudwatch.namespace": "AWS/ApiGateway",
"aws.dimensions": {
"ApiId": "6am7mj7jqx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,50 @@
"expected": [
{
"@timestamp": "2024-05-01T08:24:00Z",
"agent.type": "firehose",
"aws.apigateway.metrics.4XXError": {
"count": 1,
"max": 0.0,
"min": 0.0,
"sum": 0.0
"agent": {
"type": "firehose"
},
"aws.cloudwatch.namespace": "AWS/ApiGateway",
"aws.dimensions": {
"ApiId": "6am7mj7jqx"
"aws": {
"apigateway": {
"metrics": {
"4XXError": {
"count": 1,
"max": 0.0,
"min": 0.0,
"sum": 0.0
}
}
},
"cloudwatch": {
"namespace": "AWS/ApiGateway"
},
"dimensions": {
"ApiId": "6am7mj7jqx"
},
"exporter": {
"arn": "arn:aws:cloudwatch:ap-southeast-2:12345678901:metric-stream/test-firehose-metrics"
},
"firehose": {
"arn": "arn:aws:firehose:ap-southeast-2:12345678901:deliverystream/KS-PUT-ELI-2",
"parameters": {
"X-Found-Cluster": "bb8e51259abe4c21996954f5cfe90af1"
},
"request_id": "adcedd1d-00d2-4499-a917-4fba68f55427"
},
"metrics_names_fingerprint": "b3FPw421v4azg2Ho4+VG3EZXNFI="
},
"cloud": {
"account": {
"id": "12345678901"
},
"provider": "aws",
"region": "ap-southeast-2"
},
"data_stream": {
"dataset": "aws.apigateway_metrics",
"namespace": "default",
"type": "metrics"
},
"aws.exporter.arn": "arn:aws:cloudwatch:ap-southeast-2:12345678901:metric-stream/test-firehose-metrics",
"cloud.account.id": "12345678901",
"cloud.provider": "aws",
"cloud.region": "ap-southeast-2",
"data_stream.dataset": "aws.apigateway_metrics",
"data_stream.namespace": "default",
"data_stream.type": "metrics",
"ecs": {
"version": "8.11.0"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"events": [
{
"@timestamp": "2024-09-25T23:12:00.000Z",
"agent.type": "firehose",
"cloud.provider": "aws",
"cloud.account.id": "627286350134",
"cloud.region": "eu-central-1",
"aws.exporter.arn": "arn:aws:cloudwatch:eu-central-1:627286350134:metric-stream/CustomFull-KefpMG",
"aws.cloudwatch.namespace": "AWS/Kinesis",
"aws.firehose.arn": "arn:aws:firehose:eu-central-1:627286350134:deliverystream/KS-PUT-ELI-2",
"aws.firehose.request_id": "7628c293-ba54-4ea4-9abe-d256976c1dbd",
"aws.dimensions": {
"StreamName": "test-esf-encrypted"
},
"aws.kinesis.metrics.GetRecords_Success": {
"count": 240,
"sum": 240,
"avg": 1,
"max": 1,
"min": 1
},
"aws.kinesis.metrics.ReadProvisionedThroughputExceeded": {
"count": 240,
"sum": 0,
"avg": 0,
"max": 0,
"min": 0
},
"aws.kinesis.metrics.GetRecords_Bytes": {
"count": 240,
"sum": 0,
"avg": 0,
"max": 0,
"min": 0
},
"aws.firehose.parameters.X-Found-Cluster": "bb8e51259abe4c21996954f5cfe90af1",
"data_stream.type": "metrics",
"data_stream.dataset": "aws.cloudwatch",
"data_stream.namespace": "default"
},
{
"@timestamp": "2024-09-25T23:12:00.000Z",
"agent.type": "firehose",
"cloud.provider": "aws",
"cloud.account.id": "627286350134",
"cloud.region": "eu-central-1",
"aws.exporter.arn": "arn:aws:cloudwatch:eu-central-1:627286350134:metric-stream/CustomFull-KefpMG",
"aws.cloudwatch.namespace": "AWS/Kinesis",
"aws.firehose.arn": "arn:aws:firehose:eu-central-1:627286350134:deliverystream/KS-PUT-ELI-2",
"aws.firehose.request_id": "7628c293-ba54-4ea4-9abe-d256976c1dbd",
"aws.dimensions": {
"StreamName": "test-esf-encrypted"
},
"aws.kinesis.metrics.ReadProvisionedThroughputExceeded": {
"count": 240,
"sum": 0,
"avg": 0,
"max": 0,
"min": 0
},
"aws.kinesis.metrics.GetRecords_Bytes": {
"count": 240,
"sum": 0,
"avg": 0,
"max": 0,
"min": 0
},
"aws.kinesis.metrics.GetRecords_Success": {
"count": 240,
"sum": 240,
"avg": 1,
"max": 1,
"min": 1
},
"aws.firehose.parameters.X-Found-Cluster": "bb8e51259abe4c21996954f5cfe90af1",
"data_stream.type": "metrics",
"data_stream.dataset": "aws.cloudwatch",
"data_stream.namespace": "default"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
"expected": [
{
"@timestamp": "2024-09-25T23:12:00.000Z",
"agent": {
"type": "firehose"
},
"aws": {
"cloudwatch": {
"namespace": "AWS/Kinesis"
},
"dimensions": {
"StreamName": "test-esf-encrypted"
},
"exporter": {
"arn": "arn:aws:cloudwatch:eu-central-1:627286350134:metric-stream/CustomFull-KefpMG"
},
"firehose": {
"arn": "arn:aws:firehose:eu-central-1:627286350134:deliverystream/KS-PUT-ELI-2",
"parameters": {
"X-Found-Cluster": "bb8e51259abe4c21996954f5cfe90af1"
},
"request_id": "7628c293-ba54-4ea4-9abe-d256976c1dbd"
},
"kinesis": {
"metrics": {
"GetRecords_Bytes": {
"avg": 0,
"count": 240,
"max": 0,
"min": 0,
"sum": 0
},
"GetRecords_Success": {
"avg": 1,
"count": 240,
"max": 1,
"min": 1,
"sum": 240
},
"ReadProvisionedThroughputExceeded": {
"avg": 0,
"count": 240,
"max": 0,
"min": 0,
"sum": 0
}
}
},
"metrics_names_fingerprint": "jayZkk20Wp5tUj8uJIH97j1aJMU="
},
"cloud": {
"account": {
"id": "627286350134"
},
"provider": "aws",
"region": "eu-central-1"
},
"data_stream": {
"dataset": "aws.kinesis",
"namespace": "default",
"type": "metrics"
},
"ecs": {
"version": "8.11.0"
}
},
{
"@timestamp": "2024-09-25T23:12:00.000Z",
"agent": {
"type": "firehose"
},
"aws": {
"cloudwatch": {
"namespace": "AWS/Kinesis"
},
"dimensions": {
"StreamName": "test-esf-encrypted"
},
"exporter": {
"arn": "arn:aws:cloudwatch:eu-central-1:627286350134:metric-stream/CustomFull-KefpMG"
},
"firehose": {
"arn": "arn:aws:firehose:eu-central-1:627286350134:deliverystream/KS-PUT-ELI-2",
"parameters": {
"X-Found-Cluster": "bb8e51259abe4c21996954f5cfe90af1"
},
"request_id": "7628c293-ba54-4ea4-9abe-d256976c1dbd"
},
"kinesis": {
"metrics": {
"GetRecords_Bytes": {
"avg": 0,
"count": 240,
"max": 0,
"min": 0,
"sum": 0
},
"GetRecords_Success": {
"avg": 1,
"count": 240,
"max": 1,
"min": 1,
"sum": 240
},
"ReadProvisionedThroughputExceeded": {
"avg": 0,
"count": 240,
"max": 0,
"min": 0,
"sum": 0
}
}
},
"metrics_names_fingerprint": "jayZkk20Wp5tUj8uJIH97j1aJMU="
},
"cloud": {
"account": {
"id": "627286350134"
},
"provider": "aws",
"region": "eu-central-1"
},
"data_stream": {
"dataset": "aws.kinesis",
"namespace": "default",
"type": "metrics"
},
"ecs": {
"version": "8.11.0"
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"start_timestamp": "2024-06-12T21:59:00.000Z",
"agent.type": "firehose",
"cloud.provider": "aws",
"cloud.account.id": "627286350134",
"cloud.account.id": "12345678901",
"cloud.region": "us-east-1",
"aws.exporter.arn": "arn:aws:cloudwatch:us-east-1:627286350134:metric-stream/test-all-metrics-ks-1",
"aws.exporter.arn": "arn:aws:cloudwatch:us-east-1:12345678901:metric-stream/test-all-metrics-ks-1",
"aws.firehose.arn": "arn:aws:firehose:us-east-1:12345678901:deliverystream/KS-PUT-ELI-2",
"aws.firehose.request_id": "adcedd1d-00d2-4499-a917-4fba68f55427",
"aws.cloudwatch.namespace": "AWS/RDS",
"aws.dimensions": {
"DBInstanceIdentifier": "metricbeat-test-019e245b"
Expand All @@ -19,7 +21,10 @@
"min": 18430775296,
"max": 18430775296
},
"aws.firehose.parameters.X-Found-Cluster": "c335685bb4614254a283e02799f09d63"
"aws.firehose.parameters.X-Found-Cluster": "c335685bb4614254a283e02799f09d63",
"data_stream.type": "metrics",
"data_stream.dataset": "aws.cloudwatch",
"data_stream.namespace": "default"
}
]
}
Loading

0 comments on commit d93fd8f

Please sign in to comment.