-
Couldn't load subscription status.
- Fork 947
Add business metrics implementation guidelines #6527
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
base: master
Are you sure you want to change the base?
Conversation
|
|
|
||
| ### Avoid Request Mutation for Business Metrics | ||
|
|
||
| **SHOULD NOT** use request mutation (`.toBuilder().build()`) for adding business metrics as it creates unnecessary object copies and performance overhead. |
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.
What about high level features which adds the User agent where the features are resolved before the context is built based on the Client settings? Should we also directly add it to the Execution Attribute ? (As in Transfer manager, Batch manager, CrossRegion etc)
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.
Hmm yeah, good point to cover! Yes, if there are cases where high-level features are resolved before ExecutionContext is built and we can't access ExecutionAttributes directly.
We have two options: if we can somehow determine the feature from client configuration or execution parameters (like retry mode and protocol detection already do), then we can add it in AwsExecutionContextBuilder in core which avoids request mutation. But, if the feature requires analyzing specific request details that aren't available in client config, then request mutation is acceptable as a fallback ig. Will update the doc about it.
|
Thanks for creating the guidelines this is very helpful. |
Changes to existing business metrics should be treated as backward compatible and only require a minor version bump I feel, what do you think? Since business metrics are purely observational, and don't affect SDK functionality or customer code behavior, customer applications remain unaffected, so changes like modifying an existing business metric are safe changes I feel. A minor version bump is sufficient and helps teams track when metric changes were introduced. |
yeap minor version bump looks good |



This PR adds guidelines for implementing business metrics in the AWS SDK for Java v2, based on team decisions.