Is your feature request related to a problem? Please describe.
At Mesmer project we are working on an instrumentation library for Scala applications, and recent change in agent-for-testing for AggregationTemporality from cumulative to delta caused many issues in our tests - they either broke or became flaky. The issue is related to the style of testing we are doing, which is quite typical to Scala codebases - we call async code without clearly knowing when it will finish executing, so after calling it we immediately start polling assertions that check for metrics being produced by said async code for success for a certain amount of time until they succeed or finally fail. This polling, which fetches exported metrics from agent-for-testing, combined with delta temporality makes metric output from the exporter non-deterministic, and this breaks our test assertions. Of course, we could force certain constraints on our tests that would make them comform to behavior of delta temporality, but such approach feels excessively limiting. As a workaround for this, we started building agent-for-testing JAR on our own, with only one line change that reverts temporality back to cumulative.
Describe the solution you'd like
We suggest adding a way to configure temporality for agent-for-testing, possibly by adding a system property which we could pass on application startup.
Describe alternatives you've considered
Only alternatives we see is either refactoring our tests or building agent-for-testing JAR on our own, both seem non-ideal options.
Is your feature request related to a problem? Please describe.
At Mesmer project we are working on an instrumentation library for Scala applications, and recent change in
agent-for-testingforAggregationTemporalityfromcumulativetodeltacaused many issues in our tests - they either broke or became flaky. The issue is related to the style of testing we are doing, which is quite typical to Scala codebases - we call async code without clearly knowing when it will finish executing, so after calling it we immediately start polling assertions that check for metrics being produced by said async code for success for a certain amount of time until they succeed or finally fail. This polling, which fetches exported metrics fromagent-for-testing, combined withdeltatemporality makes metric output from the exporter non-deterministic, and this breaks our test assertions. Of course, we could force certain constraints on our tests that would make them comform to behavior ofdeltatemporality, but such approach feels excessively limiting. As a workaround for this, we started buildingagent-for-testingJAR on our own, with only one line change that reverts temporality back tocumulative.Describe the solution you'd like
We suggest adding a way to configure temporality for
agent-for-testing, possibly by adding a system property which we could pass on application startup.Describe alternatives you've considered
Only alternatives we see is either refactoring our tests or building
agent-for-testingJAR on our own, both seem non-ideal options.