Skip to content

Azure Service Bus Metrics. How to configure. (Resource type: Microsoft.ServiceBus/namespaces not enabled for Cross Resource metrics) #114

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

Open
virasana opened this issue May 15, 2025 · 0 comments

Comments

@virasana
Copy link

Resource type: Microsoft.ServiceBus/namespaces not enabled for Cross Resource metrics

I have set up Azure Metrics Exporter in AKS, using ServiceMonitor. Prometheus service discovery and targets are OK and I can query the exporter via the browser. I can see the /query interface and have tried setting up the additional scrape targets in Prometheus as below - I get the error further below:

`

  • job_name: azure-metrics-exporter
    scrape_interval: 1m
    metrics_path: /probe/metrics
    params:
    name:
    - azure_metric
    template:
    - '{name}{metric}{aggregation}_{unit}'
    help:
    - Azure metric {metric} for {aggregation}
    subscription:
    - a1234567890-etc
    resourceType:
    - Microsoft.ServiceBus/namespaces
    region:
    - westeurope
    metricNamespace:
    - Microsoft.ServiceBus/namespaces
    metric:
    - IncomingMessages
    interval:
    - PT1H
    timespan:
    - PT1H
    aggregation:
    - average
    - total
    - count
    metricTop:
    - 10
    validateDimensions:
    - 'true'
    static_configs:
    - targets:
    - "azure-metrics-exporter-service.azmonitormetrics.svc.cluster.local:80"
    `

I get the following error:

Resource type: Microsoft.ServiceBus/namespaces not enabled for Cross Resource metrics

`
$>kubectl logs azmonitormetrics-azure-metrics-exporter-5578b849df-dvjtr

azmonitormetrics-azure-metrics-exporter-5578b849df-dvjtr azmonitormetrics 2025-05-15T16:05:55.452696105+01:00 {"level":"error","caller":"metrics/prober.go:242","msg":"GET https://management.azure.com/subscriptions/banana/providers/Microsoft.Insights/metrics\n--------------------------------------------------------------------------------\nRESPONSE 400: 400 Bad Request\nERROR CODE: BadRequest\n--------------------------------------------------------------------------------\n{\n "error": {\n "additionalInfo": [\n {\n "type": "string",\n "info": "TraceId=2086b941-ccab-4f14-89d7-bc5e160132b5"\n },\n {\n "type": "string",\n "info": "DateTime=2025-05-15T15:05:55.3691140Z"\n },\n {\n "type": "string",\n "info": "ExceptionType=Microsoft.Online.Metrics.MetricsMP.Utilities.RPRequestFormatException"\n }\n ],\n "code": "BadRequest",\n "message": "Resource type: Microsoft.ServiceBus/namespaces not enabled for Cross Resource metrics"\n }\n}\n--------------------------------------------------------------------------------\n","requestPath":"/probe/metrics","paramName":["azure_metric"],"paramResourceType":["Microsoft.ServiceBus/namespaces"],"paramTemplate":["{name}{metric}{aggregation}_{unit}"],"paramAggregation":["average","total","count"],"paramSubscription":["banana"],"paramTimespan":["PT1H"],"paramValidateDimensions":["true"],"paramHelp":["Azure metric {metric} for {aggregation}"],"paramInterval":["PT1H"],"paramMetric":["Messages"],"paramMetricNamespace":["Microsoft.ServiceBus/namespaces"],"paramMetricTop":["10"],"stacktrace":"github.com/webdevops/azure-metrics-exporter/metrics.(*MetricProber).collectMetricsFromSubscriptions.func1.1\n\t/go/src/github.com/webdevops/azure-metrics-exporter/metrics/prober.go:242\ngithub.com/webdevops/go-common/azuresdk/armclient.(*SubscriptionsIterator).ForEachAsync.func1\n\t/go/pkg/mod/github.com/webdevops/go-common@v0.0.0-20250501164923-7cab87d11d0f/azuresdk/armclient/iterator.subscriptions.go:113"}
`

How do I configure Azure Service Bus metrics and resolve the error above?

Many Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant