0

Hello i was working on getting requests through the Azure API Management , however i am getting all the api exsiting. i wanted to filter just the apis i needed

here is what i did :

requests
|summarize totalCount=sum(itemCount) by bin(timestamp,15m),toString(customDimensions.["API Name"])
where (toString(customDimensions.["API Name"]) == "api1" && "api2"
|render timechart

when i test it tells me status : something is broken , how can i filter just the api that i need from all

medone
  • 3
  • 2
  • did you try something like toString(customDimensions.["API Name"]) in ("api1", "api2") ? – Kai Walter Mar 03 '21 at 07:48
  • maybe please correct question to "How to query multiple Azure API Management API names with Application Insights query" so that it is more concise. – Kai Walter Mar 03 '21 at 07:56

4 Answers4

1

change the query to

requests
| extend apiName = tostring(customDimensions.["API Name"])
| summarize totalCount=sum(itemCount) by bin(timestamp,15m),apiName
| where apiName in ("api1", "api2")
| render timechart
Kai Walter
  • 3,485
  • 2
  • 32
  • 62
  • 1
    I found the language called kusto : https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/ and yeah it worked for me , thanks – medone Mar 04 '21 at 13:48
0

To dive deeper into the requests, you application insights. You can link ApplicationInsights to APIM instance for monitoring.

Create Application Insights in Azure and copy the generated Instrumentation key.

Browse to APIM Resource, scroll to Monitoring section to select Application Insights. Use the above copied Instrumentation key.

Monitoring is not On by default for all incoming and outgoing. To enable it, in APIM scroll to API section to select APIs. On the top select Settings and enable Application Insights. enter image description here

Now it is all set to monitor your APIs.

koushik
  • 320
  • 6
  • 14
0

Found the solution in the azure documentation . the language is called kusto here is the link to the documentation: Azure Kusto Query language

requests
| extend apiName = tostring(customDimensions.["API Name"])
| summarize totalCount=sum(itemCount) by bin(timestamp,15m),apiName
| where apiName in ("api1", "api2")
| render timechart
medone
  • 3
  • 2
0

When configuring the Application Insights Diagnostics Logs, don't forget to set the number of payload bytes to an adequate value. This will give you more information from the requests and responses you are monitoring.

enter image description here

K.J.M.O.
  • 145
  • 2
  • 14