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

ServiceBus metric error when Dimension is not EntityName #2557

Open
maletsiri opened this issue Oct 10, 2024 · 3 comments
Open

ServiceBus metric error when Dimension is not EntityName #2557

maletsiri opened this issue Oct 10, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@maletsiri
Copy link

Report

when a metric dimension does not include EntityName, the scrapping results in Bad Request

Here is a list of metrics for a Service Bus: #https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-servicebus-namespaces-metrics

The following metric names do not work as they don't have EntityName as one of the dimension they support, only EntityName metric work.

  • ActiveConnections, Dimension: none
  • NamespaceCpuUsage, Dimension: Replica
  • NamespaceMemoryUsage, Dimension: Replica
  • PendingCheckpointOperationCount, Dimension: none

Expected Behavior

  • ActiveConnections: Total: 34
  • NamespaceCpuUsage: Maximum: 78
  • NamespaceMemoryUsage: Maximum: 67
  • PendingCheckpointOperationCount: Total: 23

Actual Behavior

when the configuration does not explicitly details the dimension, the following is observed in the logs

azureMetricConfiguration:
metricName: ActiveConnections
aggregation:
type: Total
interval: 00:15:00

[07:41:12 FTL] BadRequest: Metric: NamespaceCpuUsage does not support requested dimension combination: entityname, supported ones are: , TraceId: {b97c783f-68a7-494c-93be-df8edc459425}
[07:41:12 FTL] BadRequest: Metric: ActiveConnections does not support requested dimension combination: entityname, supported ones are: , TraceId: {15937d8b-9d95-421c-ae92-82ece5cfa310}
[07:41:12 FTL] BadRequest: Metric: NamespaceMemoryUsage does not support requested dimension combination: entityname, supported ones are: , TraceId: {5f2d157d-4fb8-430d-925f-d067a39a360f}

when dimension is included in the spec
Note, if you don't specify dimension, it will auto use EntityName as dimension

azureMetricConfiguration:
metricName: ActiveConnections
limit: 5
dimension:
name: "none"
aggregation:
type: Total
interval: 00:15:00

in the case of NamespaceCpuUsage

azureMetricConfiguration:
metricName: NamespaceCpuUsage
limit: 5
dimension:
name: Replica
aggregation:
type: Maximum
interval: 00:15:00

the following error is in the logs

[07:34:27 FTL] BadRequest: Metric: NamespaceMemoryUsage can not support requested dimensions: replica, because it include hidden dimensions: Replica
[07:34:27 FTL] BadRequest: Metric: NamespaceCpuUsage can not support requested dimensions: replica, because it include hidden dimensions: Replica
BadRequest: Metric: ActiveConnections does not support requested dimension combination: entityname, supported ones are: , TraceId: {ec07be04-46cc-4b44-b16d-35580a53bf8d}

Steps to Reproduce the Problem

  1. select any metric for servicebus that does not have EntityName as the dimension
  2. https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-servicebus-namespaces-metrics
  3. Dimensions of Replica and none don't work.
    ...

Component

Scraper

Version

v2.11

Configuration

Configuration:

azureMetricConfiguration:
metricName: NamespaceCpuUsage
limit: 5
dimension:
name: Replica
aggregation:
type: Maximum
interval: 00:15:00

Logs

[07:34:27 FTL] BadRequest: Metric: NamespaceMemoryUsage can not support requested dimensions: replica, because it include hidden dimensions: Replica
[07:34:27 FTL] BadRequest: Metric: NamespaceCpuUsage can not support requested dimensions: replica, because it include hidden dimensions: Replica
BadRequest: Metric: ActiveConnections does not support requested dimension combination: entityname, supported ones are: , TraceId: {ec07be04-46cc-4b44-b16d-35580a53bf8d}

Platform

Microsoft Azure

Contact Details

[email protected]

@maletsiri maletsiri added the bug Something isn't working label Oct 10, 2024
Copy link

Thank you for opening an issue! We rely on the community to maintain Promitor. (Learn more)

Is this something you want to contribute?

@hkfgo
Copy link
Collaborator

hkfgo commented Oct 24, 2024

We had ran into the same issue. I believe it's because dedicated scraper class for ServiceBus always include an EntityName filter in its requests:

protected override string DetermineMetricFilter(string metricName, TResourceDefinition resourceDefinition)

But not all metrics support the EntityNamedimension: https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-servicebus-namespaces-metrics

I saw the scraper was written years ago, and I suspect some the underlying assumptions about MessageBus can't quite hold now. @tomkerkhove unless there's a way to override that EntityName dimension filter in configuration(I don't believe so), this would probably require a PR to fix. I'll see if I or anyone on my team has bandwidth to take a look

@tomkerkhove
Copy link
Owner

I'm open to any PR; back then this was the best approach that causes the least friction. However, we need to make it backwards compatible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Proposed
Development

No branches or pull requests

3 participants