Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
383 stars 1.24k forks source link

az monitor app-insights query returns 0 rows #3265

Open realrubberduckdev opened 3 years ago

realrubberduckdev commented 3 years ago

Extension name (the extension in question)

az monitor app-insights query

Description of issue (in as much detail as possible)

A query in the lines of:

az monitor app-insights query --app "/subscriptions/2dcc85b8-fc8a-4645-a8e9-f469ef408593/resourceGroups/rg1/providers/microsoft.insights/components/appinsights1" --analytics-query "pageViews"

returns 0 rows

"rows": []

The empty result looks like this:

{
  "tables": [
    {
      "columns": [
        {
          "name": "timestamp",
          "type": "datetime"
        },
        {
          "name": "id",
          "type": "string"
        },
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "url",
          "type": "string"
        },
        {
          "name": "duration",
          "type": "real"
        },
        {
          "name": "performanceBucket",
          "type": "string"
        },
        {
          "name": "itemType",
          "type": "string"
        },
        {
          "name": "customDimensions",
          "type": "dynamic"
        },
        {
          "name": "customMeasurements",
          "type": "dynamic"
        },
        {
          "name": "operation_Name",
          "type": "string"
        },
        {
          "name": "operation_Id",
          "type": "string"
        },
        {
          "name": "operation_ParentId",
          "type": "string"
        },
        {
          "name": "operation_SyntheticSource",
          "type": "string"
        },
        {
          "name": "session_Id",
          "type": "string"
        },
        {
          "name": "user_Id",
          "type": "string"
        },
        {
          "name": "user_AuthenticatedId",
          "type": "string"
        },
        {
          "name": "user_AccountId",
          "type": "string"
        },
        {
          "name": "application_Version",
          "type": "string"
        },
        {
          "name": "client_Type",
          "type": "string"
        },
        {
          "name": "client_Model",
          "type": "string"
        },
        {
          "name": "client_OS",
          "type": "string"
        },
        {
          "name": "client_IP",
          "type": "string"
        },
        {
          "name": "client_City",
          "type": "string"
        },
        {
          "name": "client_StateOrProvince",
          "type": "string"
        },
        {
          "name": "client_CountryOrRegion",
          "type": "string"
        },
        {
          "name": "client_Browser",
          "type": "string"
        },
        {
          "name": "cloud_RoleName",
          "type": "string"
        },
        {
          "name": "cloud_RoleInstance",
          "type": "string"
        },
        {
          "name": "appId",
          "type": "string"
        },
        {
          "name": "appName",
          "type": "string"
        },
        {
          "name": "iKey",
          "type": "string"
        },
        {
          "name": "sdkVersion",
          "type": "string"
        },
        {
          "name": "itemId",
          "type": "string"
        },
        {
          "name": "itemCount",
          "type": "int"
        }
      ],
      "name": "PrimaryResult",
      "rows": []
    }
  ]
}

Even though the same query on azure portal returns values.

The same happens with browserTimings and exceptions. All of these return values on portal.

Other tables like requests, dependencies, performanceCounters return result rows.

Am I doing something wrong with the query in az cli?

yonzhan commented 3 years ago

monitor

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @SameergMS, @dadunl.

Issue Details
### Extension name (the extension in question) az monitor app-insights query ### Description of issue (in as much detail as possible) A query in the lines of: ``` az monitor app-insights query --app "/subscriptions/2dcc85b8-fc8a-4645-a8e9-f469ef408593/resourceGroups/rg1/providers/microsoft.insights/components/appinsights1" --analytics-query "pageViews" ``` returns 0 rows ``` "rows": [] ``` The empty result looks like this: ``` { "tables": [ { "columns": [ { "name": "timestamp", "type": "datetime" }, { "name": "id", "type": "string" }, { "name": "name", "type": "string" }, { "name": "url", "type": "string" }, { "name": "duration", "type": "real" }, { "name": "performanceBucket", "type": "string" }, { "name": "itemType", "type": "string" }, { "name": "customDimensions", "type": "dynamic" }, { "name": "customMeasurements", "type": "dynamic" }, { "name": "operation_Name", "type": "string" }, { "name": "operation_Id", "type": "string" }, { "name": "operation_ParentId", "type": "string" }, { "name": "operation_SyntheticSource", "type": "string" }, { "name": "session_Id", "type": "string" }, { "name": "user_Id", "type": "string" }, { "name": "user_AuthenticatedId", "type": "string" }, { "name": "user_AccountId", "type": "string" }, { "name": "application_Version", "type": "string" }, { "name": "client_Type", "type": "string" }, { "name": "client_Model", "type": "string" }, { "name": "client_OS", "type": "string" }, { "name": "client_IP", "type": "string" }, { "name": "client_City", "type": "string" }, { "name": "client_StateOrProvince", "type": "string" }, { "name": "client_CountryOrRegion", "type": "string" }, { "name": "client_Browser", "type": "string" }, { "name": "cloud_RoleName", "type": "string" }, { "name": "cloud_RoleInstance", "type": "string" }, { "name": "appId", "type": "string" }, { "name": "appName", "type": "string" }, { "name": "iKey", "type": "string" }, { "name": "sdkVersion", "type": "string" }, { "name": "itemId", "type": "string" }, { "name": "itemCount", "type": "int" } ], "name": "PrimaryResult", "rows": [] } ] } ``` Even though the same query on azure portal returns values. The same happens with `browserTimings` and `exceptions`. All of these return values on portal. Other tables like `requests`, `dependencies`, `performanceCounters` return result rows. Am I doing something wrong with the query in az cli?
Author: realrubberduckdev
Assignees: kairu-ms
Labels: `Monitor`, `Service Attention`
Milestone: S186
kairu-ms commented 3 years ago

Hi @sameergMS @dadunl, can you have a look at this issue?

kairu-ms commented 3 years ago

I think that may caused by different api-version. CLI and portal are calling different api-versions. @realrubberduckdev Can you update application-insights by the follow command and try again?

az extension update -n application-insights
realrubberduckdev commented 3 years ago

Hi @kairu-ms I am using

{
    "experimental": false,
    "installed": true,
    "name": "application-insights",
    "preview": true,
    "summary": "Support for managing Application Insights components and querying metrics, events, and logs from such components.",
    "version": "0.1.13"
  }

And update command returns:

az extension update -n application-insights
No updates available for 'application-insights'. Use --debug for more information.

Seems I am at the latest version.

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @SameergMS, @dadunl.

Issue Details
### Extension name (the extension in question) az monitor app-insights query ### Description of issue (in as much detail as possible) A query in the lines of: ``` az monitor app-insights query --app "/subscriptions/2dcc85b8-fc8a-4645-a8e9-f469ef408593/resourceGroups/rg1/providers/microsoft.insights/components/appinsights1" --analytics-query "pageViews" ``` returns 0 rows ``` "rows": [] ``` The empty result looks like this: ``` { "tables": [ { "columns": [ { "name": "timestamp", "type": "datetime" }, { "name": "id", "type": "string" }, { "name": "name", "type": "string" }, { "name": "url", "type": "string" }, { "name": "duration", "type": "real" }, { "name": "performanceBucket", "type": "string" }, { "name": "itemType", "type": "string" }, { "name": "customDimensions", "type": "dynamic" }, { "name": "customMeasurements", "type": "dynamic" }, { "name": "operation_Name", "type": "string" }, { "name": "operation_Id", "type": "string" }, { "name": "operation_ParentId", "type": "string" }, { "name": "operation_SyntheticSource", "type": "string" }, { "name": "session_Id", "type": "string" }, { "name": "user_Id", "type": "string" }, { "name": "user_AuthenticatedId", "type": "string" }, { "name": "user_AccountId", "type": "string" }, { "name": "application_Version", "type": "string" }, { "name": "client_Type", "type": "string" }, { "name": "client_Model", "type": "string" }, { "name": "client_OS", "type": "string" }, { "name": "client_IP", "type": "string" }, { "name": "client_City", "type": "string" }, { "name": "client_StateOrProvince", "type": "string" }, { "name": "client_CountryOrRegion", "type": "string" }, { "name": "client_Browser", "type": "string" }, { "name": "cloud_RoleName", "type": "string" }, { "name": "cloud_RoleInstance", "type": "string" }, { "name": "appId", "type": "string" }, { "name": "appName", "type": "string" }, { "name": "iKey", "type": "string" }, { "name": "sdkVersion", "type": "string" }, { "name": "itemId", "type": "string" }, { "name": "itemCount", "type": "int" } ], "name": "PrimaryResult", "rows": [] } ] } ``` Even though the same query on azure portal returns values. The same happens with `browserTimings` and `exceptions`. All of these return values on portal. Other tables like `requests`, `dependencies`, `performanceCounters` return result rows. Am I doing something wrong with the query in az cli?
Author: realrubberduckdev
Assignees: kairu-ms
Labels: `Monitor`, `Service Attention`
Milestone: Backlog
MarkusPfundstein commented 1 year ago

I am having the same issue right now. Has this ever been analysed?