Skip to content

1.52

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 15 Jul 17:40
· 10 commits to refs/heads/develop since this release
43bfa78

Summary

We're thrilled to announce the addition of support for multiple dimension sets within the same Metrics instance. This new feature allows users to gain more granular insights and comprehensive views of their applications by creating aggregating metrics across various dimensions.

Key Features

  • New AddDimensions() method for adding multiple dimensions at once
  • Support for multiple dimension sets in a single Metrics instance
  • Maintains backwards compatibility with existing AddDimension() method
  • Automatic handling of duplicate dimension sets
  • Ensures only the latest dimension value is used as a target member on the root EMF node

Getting Started

To leverage this new functionality, simply use the new AddDimensions() method in your code:

Metrics.AddDimensions(("environment", "prod"), ("region", "us-west-2"));
Metrics.AddDimensions(("environment", "prod"));
Metrics.AddDimensions(("region", "us-west-2"));

Metrics.AddMetric("ExecutionTime", DateTime.Now, Unit.MILLISECONDS);

This will generate CloudWatch Metrics with multiple dimension sets, allowing for more flexible and detailed metric analysis.

Enhanced Metric Output

The new feature produces an enhanced metric output structure, as shown in this example:

{
  "_aws": {
    "Timestamp": 1742467748165,
    "CloudWatchMetrics": [
      {
        "Namespace": "HelloWorldFunction",
        "Metrics": [
          {
            "Name": "ExecutionTime",
            "Unit": "Milliseconds"
          }
        ],
        "Dimensions": [
          [
            "Service"
          ],
          [
            "environment",
            "region"
          ],
          [
            "environment"
          ],
          [
            "region"
          ]
        ]
      }
    ]
  },
  "function_request_id": "c0e5afc1-c033-4aa6-9b13-26bfc324874b",
  "ExecutionTime": 0.0,
  "environment": "prod",
  "functionVersion": "$LATEST",
  "Service": "Powertools",
  "logStreamId": "$LATEST",
  "region": "us-west-2",
  "executionEnvironment": "AWS_Lambda_java17"
}

Changes

📜 Documentation updates

  • chore(deps): bump squidfunk/mkdocs-material from eb04b60 to 0bfdba4 in /docs (#921) by @dependabot[bot]

🔧 Maintenance

This release was made possible by the following contributors:

@hjgraca and dependabot[bot]