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

[azuremonitor receiver] Don't scrape metrics namespace when not equal to a resource type #37220

Open
celian-garcia opened this issue Jan 14, 2025 · 2 comments
Labels
bug Something isn't working needs triage New item requiring triage receiver/azuremonitor

Comments

@celian-garcia
Copy link

Component(s)

receiver/azuremonitor

What happened?

Description

The azuremonitor receiver is not able to retrieve metrics with a namespace being different from resource type. Typically like {resource type}/something e.g Microsoft.Storage/storageAccounts/blobServices.

Technically, what it does is that for each resource type, and for each resource, it get metrics definition using this Azure Metric Definitions - List API. Which means that it takes a storage account resource and get the shape of the metrics (metric names, dimensions, etc..) from it. By default it seems to get only the metric namespace that is equal to the name of the resource type "Microsoft.Storage/storageAccounts" and not all the rest "Microsoft.Storage/storageAccounts/*"

So to make it simple it does

  • GET resources of type "Microsoft.Storage/storageAccounts" -> find X resources
  • for each resource, GET metrics definition of that resource, and only namespace "Microsoft.Storage/storageAccounts"
  • GET resources of type "Microsoft.Storage/storageAccounts/blobServices" -> find nothing
  • terminate
    => No metrics collecte for blob services namespace

There is a confusion between Resource type and Metric namespace in Azure that partially overlaps.
For this reason, we basically have no metrics for the "sub resource types namespaces" of this kind

Steps to Reproduce

Start an otel collector with an azure receiver and give a for example Microsoft.Storage/storageAccounts/blobServices

  azuremonitor/storageaccount-blob-tst:
    cache_resources: 3600
    client_id: <redacted>
    client_secret: <redacted>
    cloud: AzureCloud
    collection_interval: 60s
    initial_delay: 1s
    tenant_id: <redacted>
    services: [ "Microsoft.Storage/storageAccounts/blobServices" ]
    subscription_id: <redacted>

Expected Result

We should have the metrics from the blob services namesapce

Actual Result

No resources found, so no metrics

Collector version

v0.117.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

Log output

Additional context

No response

@celian-garcia celian-garcia added bug Something isn't working needs triage New item requiring triage labels Jan 14, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@celian-garcia
Copy link
Author

May be linked with #34265 as there is also a blobServices mention in the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New item requiring triage receiver/azuremonitor
Projects
None yet
Development

No branches or pull requests

1 participant