You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When querying NewRelic with canary MetricTemplates the query is being executed correctly and flagger logs the correct response JSON, however, Flagger expects a different response format from the one provided by NR. The structure expected is a key field 'result' that is then used to retrieve the query result.
Flagger expects results.[0].result in the response and NewRelic returns results.[0].any_string as detailed in their documentation and the tests.
As an example, two JSON retrieved from Flaggers log (i removed non-essential data but maintained the same structure) where the result changes depending on the function used, and using aliases on the query does not change the results filed.
16:58:59.927 - Halt advancement no values found for custom metric: newrelic-log-test: invalid response: {"results":[{"sum":9.1979529E7}],"performanceStats":{"inspectedCount":1244054,"omittedCount":0,"matchCount":431023,"wallClockTime":101,"exceedsRetentionWindow":false},"metadata":{"accounts":[111111],"eventTypes":["Log"],"eventType":"Log","openEnded":true,"beginTime":"2024-01-22T19:56:59Z","endTime":"2024-01-22T19:58:59Z","beginTimeMillis":1705953419756,"endTimeMillis":1705953539756,"rawSince":"120 SECONDS AGO","rawUntil":"NOW","rawCompareWith":"","guid":"11111111-1111-1111-1111-111111111111","routerGuid":"11111111-1111-1111-1111-111111111111","messages":[],"contents":[{"function":"sum","attribute":"numeric(response_code)","simple":true}]}}: no values found
16:59:29.189 - Rolling back myapp.api failed checks threshold reached 2
16:59:29.380 - Canary failed! Scaling down myapp.api
To Reproduce
Configure NewRelic credentials according to the documentation
Describe the bug
When querying NewRelic with canary MetricTemplates the query is being executed correctly and flagger logs the correct response JSON, however, Flagger expects a different response format from the one provided by NR. The structure expected is a key field 'result' that is then used to retrieve the query result.
Flagger expects
results.[0].result
in the response and NewRelic returnsresults.[0].any_string
as detailed in their documentation and the tests.As an example, two JSON retrieved from Flaggers log (i removed non-essential data but maintained the same structure) where the result changes depending on the function used, and using aliases on the query does not change the results filed.
Flagger logged JSON with sum query:
Flagger logged JSON with Count query and alias
as 'result'
:Flagger's metric template is a simple count query
Log from the sum test
To Reproduce
Expected behavior
Flagger reading the response despite of the json key name.
Additional context
The text was updated successfully, but these errors were encountered: