Combining the metrics by request variable in Kibana - kibana

Say I need to find 95th and 99th latency of an API with endpoint: "/api/v1/merchant/{merchantId}/logo".
In Kibana I tried searching: "/api/v1/merchant" AND "/logo". But, it returned multiple results, one for each merchantId.
How to search such that single URL is returned which combines the metrics for all merchantIds to give the output?

What you are trying to do is to filter for "api v1 merchant * logo" (mixing wildcards and string query to preserve the order) which is not possible at the moment. But if the filter "api v1 merchant" and logo is correct (aka you don't have APIs like /api/v1/merchant/logo without the id) then there is a solution.
You need a new visualization: just filter for the query and not aggregate the results by API.keyword.

Related

Graph API Get Full List of Azure AD Groups

I am trying to get a full list of every group in Azure AD. I am currently able to get 999 records with the following uri:
https://graph.microsoft.com/v1.0/groups?$top=999
According to the documentation from Microsoft there are only a couple OData query parameters available, none of which appear to be able to navigate to the next page. It also states the maximum page size is 999. I have tried using the $skip parameter to skip a certain number of records, but it is not supported:
{"error":{"code":"Request_BadRequest","message":"'$skip' is not supported by the service.",...
Is there any way to get a full list of all AAD groups? We have several thousand that I would need to get.
Some queries against Microsoft Graph return multiple pages of data either due to server-side paging or due to the use of the $top query parameter to specifically limit the page size in a request. When more than one query request is required to retrieve all the results, Microsoft Graph returns an #odata.nextLink property in the response that contains a URL to the next page of results.
For example, the following URL requests all the users in an organization with a page size of 5, specified with the $top query parameter:
https://graph.microsoft.com/v1.0/groups?$top=5
If the result contains more results, Microsoft Graph will return an #odata.nextLink property similar to the following along with the first page of results:
You can retrieve the next page of results by sending the URL value of the #odata.nextLink
ref doc - https://learn.microsoft.com/en-us/graph/paging
With $top, you can customize the result size within the range of 1 and 1000. Because of your question, I guess that 1000 is exclusive, so the range goes from 1 to 999 (inclusive). Read more about the query parameter $top here. I got the range information from List messages.
The response you get from List groups seems to not contain #odata.nextLink which you would normally expect in such a case, so GET https://graph.microsoft.com/v1.0/groups does not support pagination. That would also explain why you get an error if you try to use $skip. You can read more about $skip here.
In order to get the full list of all groups, I would stop using the query parameter $top.

BOSUN : How to get Tag_values for a specific Tag_key from BOSUN?

I have a BOSUN server running which is configured to operate on OPENTSDB. I am sending data to OPENTSDB using SCOLLECTOR every minute. What I am looking for is a way to get all possible Tag_Values for a given Tag_Key and Metric_Name which is present in OPENTSDB.
For Example Suppose I have,
metric: data.queue.capacity
tags: queue={queue1,queue2,queue3...}
I am storing capacity for a Number of Queues.This data is there in OPENTSDB.
I can query BOSUN for values of metric=data.queue.capacity using query:
q("sum:data.queue.capacity{queue=*}{}","start_time","end_time")
which gives output:
{queue:queue1} :{"timestamp1":"value1","timestamp2":"value2",...}
{queue:queue2} :{"timestamp1":"value1","timestamp2":"value2",...}
.
.
.
The result returned is grouped by different Queue values.
It is hard to use above response data to get all possible Queue names because:
It only returns data between start time and end time, So if a Queue name say
queue_not does not have a metric point between start_time and end_time, it will not
come in the response.
This gives a lot of data in response, I can aggregate but I don't think this
is the best way to get Tag values.
What I want is an API where I can give a Metric_Name and Tag_Key and i should get a JSON data having all possible Tag_Values present in OPENTSDB for that Metric_Name,Tag_Key.
After Searching I have found partial solutions:
BOSUN have API to get all Tag_values, But for only those metrics which are relayed through BOSUN.
API: /api/tagv/{tagk}/{metric}
This API accept's Tag_key and Metric_Name and for this combination gives all values of Tag_Values.
eg: http://bosun-host:port/api/tagv/{tagk}/{metric}
response:
[
"tag_value1",
"tag_value2"
]
Still I don't have a solution to get Tag_values for metric which are not relayed through BOSUN but directly to OPENTSDB.
The solution may not involve BOSUN it could be OPENTSDB API too.
As far as Bosun as concerned, relaying the datapoints to Bosun for that tag metadata is the standard way. You can use tsdbrelay so metrics get copied to Bosun but don't flow through Bosun (this way if Bosun is restarted or is down, metric flow is not interrupted).
With OpenTSDB itself you could look into OpenTSDB Metadata - but Bosun't doesn't use this feature of OpenTSDB.

Connect API V2 ListCatalog - Filter by Location ID

In Connect API V1 to get the List of Items, we would pass location_id in the url to pass get the Catalog List for the specific location.
In V2, we only pass the access_token, to get the CatalogList, however we get we get the entire CatalogList for all the different locations if a merchant has multiple locations.
Is there a way to pull the Catalog List by location in V2? Otherwise, I would filter the response that is sent back from the API, and my concern would be that it could take a large amount of time upfront to filter the catalog.
You cannot filter your item catalog by location_id, as an item catalog is associated with an account, not a location. If you are concerned about the processing time, you could cache the list of ids associated with each location and just do BatchRetrieveCatalogObjects instead.
See the documentation for List Catalog for more details.

OpenTSDB - Return list of metrics using wildcard via http

Is it possible to return a list of metrics using a wildcard?
e.g. metric=Level1.level2.*
Returns all Level3 metrics for the Level1.Level2 (just how the metrics are structured)
Result would be similar to returning all metrics like so:
http://localhost:4242/api/suggest?type=metrics&q=sys&max=1000000
Then filtering on the results for a certain string, but it would be great if there was a solution provided by the api?
cheers

Get all real analytics data having condition 'custom:user_id="XYZ"'?

I tried to automate test to validate GA events.
My approach is :-
List item use google analytics real time reporting api.
Before the test ends i will hit this api and collect the last 30 mins data
This data will be a huge chunk of formattedJson string
and in this string i will search my GA events which was supposed to push.
This approach seems to be in-efficient.
My issue is to find the analytics data which corresponds to test user.
Each user has unique user id, hence, i am trying for making the request such that api returns me the filtered data based on some custom dimension "custom:user_id='user_unique_id'" .
Is it possible to get all data having condition e.g 'custom:user_id="XYZ"'.
Please advise, how to get all ga events data for a specific event label / custom dimension ? Also, does it support dimensionFilterClauses like reporting api v4 ?
We can do it by filtering.
e.g rt:eventCategory==ProductPage
earlier i was using quote, rt:eventCategory=='ProductPage' which wasn't supported.

Resources