Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error fetching data for metricset azure.monitor #41478

Open
TomonoriSoejima opened this issue Oct 30, 2024 · 1 comment
Open

Error fetching data for metricset azure.monitor #41478

TomonoriSoejima opened this issue Oct 30, 2024 · 1 comment
Labels
needs_team Indicates that the issue/PR needs a Team:* label

Comments

@TomonoriSoejima
Copy link

From Azure logs integration, we are seeing this error.

[m3:logs]$ sed -n 1253p elastic-agent-8.13.4-a2e31a/elastic-agent-20241029-3.ndjson | jq
{
  "log.level": "error",
  "@timestamp": "2024-10-29T19:09:33.266Z",
  "message": "Error fetching data for metricset azure.monitor: GET https://management.azure.com/subscriptions/f6deb90e-2ff2-40f1-928b-6da308f4f325/resourceGroups/rg-USW2/providers/Microsoft.Sql/servers/sql-kbctrust-us-001/databases/IdentityServer/providers/Microsoft.Insights/metricDefinitions\n--------------------------------------------------------------------------------\nRESPONSE 400: 400 Bad Request\nERROR CODE: BadRequest\n--------------------------------------------------------------------------------\n{\n  \"code\": \"BadRequest\",\n  \"message\": \"Detect invalid value: Microsoft.DocumentDb/databaseAccounts for query parameter: 'metricnamespace', the value must be: Microsoft.Sql/servers/databases if the query parameter is provided, you can also skip this optional query parameter.\"\n}\n--------------------------------------------------------------------------------\n",
  "component": {
    "binary": "metricbeat",
    "dataset": "elastic_agent.metricbeat",
    "id": "azure/metrics-default",
    "type": "azure/metrics"
  },
  "log": {
    "source": "azure/metrics-default"
  },
  "log.origin": {
    "file.line": 256,
    "file.name": "module/wrapper.go",
    "function": "github.com/elastic/beats/v7/metricbeat/mb/module.(*metricSetWrapper).fetch"
  },
  "service.name": "metricbeat",
  "ecs.version": "1.6.0"
}

The error message indicates that the metricnamespace parameter in your Azure Monitor API call is set incorrectly. Specifically, the error message suggests that the metricnamespace should be set to Microsoft.Sql/servers/databases instead of Microsoft.DocumentDb/databaseAccounts when querying metrics for an SQL database.

In

"type": "Microsoft.DocumentDb/databaseAccounts"
, I can see Microsoft.DocumentDb/databaseAccounts and they all need to be replaced with Microsoft.Sql/servers/databases.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Oct 30, 2024
@botelastic
Copy link

botelastic bot commented Oct 30, 2024

This issue doesn't have a Team:<team> label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

No branches or pull requests

1 participant