- Notifications
You must be signed in to change notification settings - Fork 515
[aws] [cloudwatch_metrics] Map aws.dimensions field as object (backport of #11883) #12237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[aws] [cloudwatch_metrics] Map aws.dimensions field as object (backport of #11883) #12237
Conversation
…c#11883) Change the mapping type for the `aws.dimensions` field from `flattened` to `object`. Currently, all `*_metrics` data streams but one use the `object` mapping. The `cloudwatch_metrics` data stream uses the `flattened` type instead. We need to unify the mapping of `aws.dimensions` across all metrics-related data streams in the AWS integration. If all data streams use the exact mapping for `aws.dimensions`, users will be able to query and build a dashboard that correlates data across different data streams. # Conflicts: # packages/aws/changelog.yml # packages/aws/manifest.yml
🚀 Benchmarks reportTo see the full report comment with |
| I tested the upgrade from AWS integration 2.30.2 to 2.30.3 (the unreleased changes from this PR) with the following steps:
More details on selected steps. Started sending 1 document every 5 secs
Set up the export ELASTICSEARCH_ENDPOINTS="https://localhost:9200" export ELASTICSEARCH_API_KEY="[redacted, event if it is not need since it's local]"I used the following shell script: sequence=0 while true do cat > metrics.json <<EOF { "@timestamp": "$(date '+%Y-%m-%dT%H:%M:%S%z')", "aws": { "dimensions": { "name": "Maurizio Branca", "AutoScalingGroupName": "whatever" }, "metric": { "cpu": 10, "sequence": $sequence } } } EOF ((sequence++)) cat metrics.json | jq -c | es docs bulk -f - -i metrics-aws.cloudwatch_metrics-sdh5390 sleep 5 doneResults in: 2025/01/07 12:54:11 adding a new document: {"@timestamp":"2025-01-07T12:54:11+0100","aws":{"dimensions":{"name":"Maurizio Branca","AutoScalingGroupName":"whatever"},"metric":{"cpu":10,"sequence":0}}} 2025/01/07 12:54:11 closing bulk indexer 2025/01/07 12:54:11 Successfully indexed document 2025/01/07 12:54:11 bulk indexer closed 2025/01/07 12:54:11 getting bulk indexer stats 2025/01/07 12:54:11 Stats: {NumAdded:1 NumFlushed:1 NumFailed:0 NumIndexed:0 NumCreated:1 NumUpdated:0 NumDeleted:0 NumRequests:1}The scripts sends a document like the following every 5 secs: { "@timestamp": "2024-12-31T00:14:58+0100", "aws": { "dimensions": { "name": "Maurizio Branca", "AutoScalingGroupName": "whatever" }, "metric": { "cpu": 10, "sequence": 270 } } }Upgraded the AWS integration to 2.30.3 (unreleased, this PR)Upgrade the AWS integration package from 2.30.2 to 2.30.3. Waited for the rollout to take effectRight after the upgrade, Fleet/ES creates a new Old index // GET metrics-aws.cloudwatch_metrics-sdh5390/_settings { ".ds-metrics-aws.cloudwatch_metrics-sdh5390-2025.01.07-000001": { "settings": { "index": { "mapping": { "total_fields": { "limit": "1000", "ignore_dynamic_beyond_limit": "true" } }, "hidden": "true", "time_series": { "end_time": "2025-01-07T12:33:16.000Z", "start_time": "2025-01-07T09:54:11.000Z" },New index // GET metrics-aws.cloudwatch_metrics-sdh5390/_settings { ".ds-metrics-aws.cloudwatch_metrics-sdh5390-2025.01.07-000002": { "settings": { "index": { "mapping": { "total_fields": { "limit": "1000", "ignore_dynamic_beyond_limit": "true" } }, "hidden": "true", "time_series": { "end_time": "2025-01-07T13:03:16.000Z", "start_time": "2025-01-07T12:33:16.000Z" },Now I need to wait until Checked that the the data stream didn't lose any sequence numberAt |
packages/aws/data_stream/cloudwatch_metrics/fields/package-fields.yml Outdated Show resolved Hide resolved
Co-authored-by: muthu-mps <101238137+muthu-mps@users.noreply.github.com> Co-authored-by: Andrew Gizas <andreas.gkizas@elastic.co>
| Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
|
💚 Build Succeeded
History
cc @zmoog |
muthu-mps left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| Package aws - 2.30.3 containing this change is available at https://epr.elastic.co/package/aws/2.30.3/ |
…rt of #11883) (#12237) Change the mapping type for the `aws.dimensions` field from `flattened` to `object`. Currently, all `*_metrics` data streams but one use the `object` mapping. The `cloudwatch_metrics` data stream uses the `flattened` type instead. We need to unify the mapping of `aws.dimensions` across all metrics-related data streams in the AWS integration. If all data streams use the exact mapping for `aws.dimensions`, users will be able to query and build a dashboard that correlates data across different data streams. --------- Co-authored-by: muthu-mps <101238137+muthu-mps@users.noreply.github.com> Co-authored-by: Andrew Gizas <andreas.gkizas@elastic.co>







Proposed commit message
Change the mapping type for the
aws.dimensionsfield fromflattenedtoobject.Currently, all
*_metricsdata streams but one use theobjectmapping. Thecloudwatch_metricsdata stream uses theflattenedtype instead.We need to unify the mapping of
aws.dimensionsacross all metrics-related data streams in the AWS integration.If all data streams use the exact mapping for
aws.dimensions, users will be able to query and build a dashboard that correlates data across different data streams.Checklist
changelog.ymlfile.Author's Checklist
Related issues
aws.dimensions.*fields mapping #11806