CPS-2611 Add prometheus metrics for the cm handle searches
References
CPS-2611: Add Prometheus metrics for ID searches and CM handle searchesClosed
Assumptions
Assumption | Notes | Sign-off | |
---|---|---|---|
1 | Each instance will individually report the number of invocations. |
|
|
2 | Using the Counter metrics to report back. |
|
|
3 | Search conditions are concatenated with _ ( underscore ) |
|
|
4 | If no condition is provided then the search condition is taken to be “NONE” |
|
|
Issues and Decisions
Issue | Notes | Decision | |
---|---|---|---|
1 | Which alternative to choose from ? i.e 1 to 4 in the below table |
| Mar 3, 2025 |
Alternatives or Proposed solutions
Alternative | Notes | Result | |
---|---|---|---|
1 | Using the @Timed annotation directly on the controller layer methods.
| This will just provide the number of invocations of the methods and no formal arguments are analyzed. |
|
2 | Using the @Timed annotation on individual service layer methods.
| We will have metrics for method execution in the service method. But the information about the controller layer method will be lost. |
|
3 | Add custom code to the controller / service layer methods to add the counter dynamically. | Works. But custom code has to be part of the controller method logic. | |
4 | Use AOP and Annotation based approach and write a separate logic that takes care of the metrics. | Works.
|