Skip to content

[receiver/azuremonitorreceiver] feat: Allow to not split result by dimension #36611

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

Closed
celian-garcia opened this issue Dec 2, 2024 · 3 comments · Fixed by #37168
Closed

[receiver/azuremonitorreceiver] feat: Allow to not split result by dimension #36611

celian-garcia opened this issue Dec 2, 2024 · 3 comments · Fixed by #37168
Labels

Comments

@celian-garcia
Copy link
Member

celian-garcia commented Dec 2, 2024

Component(s)

receiver/azuremonitor

Is your feature request related to a problem? Please describe.

When collecting metrics from Microsoft Azure, there's the notion of dimensions. Each dimensions is associated to a list of values.
To get these dimensions as metadata labels, the azuremonitor receiver already collect all available dimensions in the resource definition and put them in the query filter when querying the resource metrics. This allow the query result to be "split" by dimension and thanks to that we can create the metadata labels. Cool!

Problem 1

But. In some cases Azure says that a resource definition allows a dimension and if we put them in the filter, nothing is returned.

Problem 2

Some user may want to completely disable dimensions, if they don't care about it. Or don't want a big cardinality.

Describe the solution you'd like

Problem 1 solution:

As we cannot guess by advance which dimensions is wrongly provided by Azure, we have to let the user fix it by config. Allowing her/him to override the dimensions specified by Azure.

Problem 2 solution:

A simple optout boolean, that will prevent from getting dimensions. With default value to true in order to not introduce breaking change.

Describe alternatives you've considered

No response

Additional context

No response

@celian-garcia celian-garcia added enhancement New feature or request needs triage New item requiring triage labels Dec 2, 2024
Copy link
Contributor

github-actions bot commented Dec 2, 2024

Pinging code owners:

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

Copy link
Contributor

github-actions bot commented Feb 3, 2025

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

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

@github-actions github-actions bot added the Stale label Feb 3, 2025
@celian-garcia
Copy link
Member Author

Not stale, the PR is still needing review.

@github-actions github-actions bot removed the Stale label Feb 4, 2025
atoulme pushed a commit that referenced this issue Mar 7, 2025
…mension (#37168)

Recreated from a diffferent fork. Context:
#36240

> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
> Ex. Adding a feature - Explain what this achieves.-->
> #### Description
> 
> Currently there is a mechanism allowing to split the result by
dimension, thanks to a filter param hack.
> This is great that all the dimensions are collected as labels in the
metrics, but for some resources types it could be unwanted. In cause
some concern about cardinality, or continuity of the queries between one
version to another (e.g with prometheus exporter, if one does not do a
"sum by ..." and the otelcol version is updated, the query can display
different results)
> 
> To mitigate that I propose to put an optout for this collection so if
we want for some resource types and not for others, we can create two
separate receivers for example. Or we completely opt out if we don't
want additional labels.
> 
> ### Edit: 
> After a first review, we agreed on the fact that it could do a bit
more like allowing us to specify a list of dimensions for a particular
metric.
> e.g from added documentation
> ```yaml
> receivers:
>   azuremonitor:
>     dimensions:
>       enabled: true
>       overrides:
>         "Microsoft.Network/azureFirewalls":
>           # Real example of an Azure limitation here:
>           # Dimensions exposed are Reason, Status, Protocol,
> # but when selecting Protocol in the filters, it returns nothing.
> # Note here that the metric display name is ``Network rules hit
count`` but it's programmatic value is ``NetworkRuleHit``
> # Ref:
https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-network-azurefirewalls-metrics
>           "NetworkRuleHit": [Reason, Status]
> ```
> Without this config you won't have the
``azure_networkrulehit_average_Count`` metric at all in your results
> But with the config we have it with reason and status labels:
> 
> ```# HELP azure_networkrulehit_average_Count``` 
> ```# TYPE azure_networkrulehit_average_Count gauge```
>
```azure_networkrulehit_average_Count{azuremonitor_resource_id="/subscriptions/<redacted>/resourceGroups/<redacted>/providers/Microsoft.Network/azureFirewalls/<redacted>",location="<redacted>",metadata_reason="<redacted>",metadata_status="Allow",name="<redacted>",resource_group="<redacted>",type="Microsoft.Network/azureFirewalls"}
21.875```
>
```azure_networkrulehit_average_Count{azuremonitor_resource_id="/subscriptions/<redacted>/resourceGroups/<redacted>/providers/Microsoft.Network/azureFirewalls/<redacted>",location="<redacted>",metadata_reason="<redacted>",metadata_status="Deny",name="<redacted>",resource_group="<redacted>",type="Microsoft.Network/azureFirewalls"}
10```
>  
> <!-- Issue number (e.g. #1234) or full URL to issue, if applicable.
-->
> #### Link to tracking issue
> Fixes #36611 
> 
> <!--Describe what testing was performed and which tests were added.-->
> #### Testing
> 
> <!--Describe the documentation added.-->
> #### Documentation
> 
> <!--Please delete paragraphs that you did not use before
submitting.-->

Signed-off-by: Célian Garcia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants