Skip to content

Conversation

@hong-kyungsik
Copy link
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

This PR enhances the CloudWatch metrics documentation by adding guidance about potential cost implications and metric filtering.

Specifically, it adds:

  • A warning that enabling CloudWatch metrics can lead to unexpected costs
  • An explanation that CloudWatch charges per metric name + dimensions
  • A recommendation to use Micrometer MeterFilter to limit exported metrics
  • A concrete example showing how to allow only a selected set of metrics
  • This change is documentation-only and does not alter any existing behavior.

💡 Motivation and Context

When CloudWatch metrics integration is enabled, Spring Boot Actuator and Micrometer publish a large number of default metrics.
Without explicit filtering, this may result in unintended CloudWatch costs.

Currently, the documentation does not clearly explain:

  • The cost model of CloudWatch custom metrics
  • How to control which metrics are exported

This PR addresses that gap by making the cost implications explicit and documenting a recommended way to restrict exported metrics.

While this PR does not change the default behavior, it helps clarify and mitigate the concerns raised in #873 by documenting the cost implications and recommended configuration.

The example code included in this documentation is based on the snippet originally shared by the issue author

💚 How did you test it?

  • Verified locally that a MeterFilter.denyUnless configuration allows only the specified metric names to pass through
  • Confirmed that non-whitelisted metrics are filtered out at the Micrometer level
  • No changes to runtime behavior were introduced

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated reference documentation to reflect the change
  • All tests passing
  • No breaking changes

🔮 Next steps

@github-actions github-actions bot added the type: documentation Documentation or Samples related issue label Jan 18, 2026
Copy link
Contributor

@maciejwalkowiak maciejwalkowiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@maciejwalkowiak maciejwalkowiak merged commit 0a67050 into awspring:main Jan 20, 2026
2 of 5 checks passed
@maciejwalkowiak maciejwalkowiak added this to the 4.0.0 milestone Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: documentation Documentation or Samples related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants