Skip to content

Conversation

@okapusta
Copy link

@okapusta okapusta commented Jan 16, 2019

Use custom params encoder for queries containing tags to allow array as tag value to get multiple metrics in one call. From api docs:

Tags can be searched by AND, OR, and NOT conditions on their tag values. Specifying the same tag name multiple times with different values is an OR.

Example tag set:

query = { 
     resolution: 60, 
     duration: 86400,
     tags: {
       hostname: ['app1', 'app2'],
     }   
}

With NestedParamsEncoder url generated:

https://api.appoptics.com/v1/measurements/psm.plugin.swappiness.page_faults?duration=86400&resolution=60&tags[hostname][]=app1&tags[hostname][]=app2

is invalid and returns 500 error

With ParamsEncoder:

https://api.appoptics.com/v1/measurements/psm.plugin.swappiness.page_faults?resolution=60&duration=86400&tags[hostname]=app1&tags[hostname]=app2

which works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant