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: Support querying subscriptions and resource groups in Azure Monitor Logs #34766

Merged
merged 2 commits into from May 28, 2021

Conversation

joshhunt
Copy link
Contributor

What this PR does / why we need it:

Adds support for Azure Monitor Logs queries that target Subscriptions and Resource Groups directly, rather than only a singular resource. This lets you, for example, graph all virtual machines in a resource group with a single query, which is pretty cool!

It turns out this was a lot easier than initially thought - the complication was just making sure the UI was still good when it didn't have a full resource URI

image

Which issue(s) this PR fixes:

Fixes #34482

@joshhunt joshhunt added datasource/Azure Azure Monitor Datasource add to changelog old backport v8.0.x Mark PR for automatic backport to v8.0.x labels May 26, 2021
@joshhunt joshhunt requested review from a team and andresmgot and removed request for a team May 26, 2021 17:09
Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines +90 to +91
resourcecontainers
| where type == "microsoft.resources/subscriptions"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice if microsoft developed a js library for building queries :P

Copy link
Contributor

@sunker sunker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This will be a major improvement for the users

@joshhunt joshhunt marked this pull request as ready for review May 27, 2021 19:11
@joshhunt joshhunt requested a review from a team as a code owner May 27, 2021 19:11
@joshhunt joshhunt enabled auto-merge (squash) May 27, 2021 19:11
@joshhunt joshhunt added this to the 8.0.0-beta3 milestone May 27, 2021
@joshhunt joshhunt force-pushed the joshhunt/azure-select-logs-resource-groups branch from 53c51d5 to b2e0aa4 Compare May 27, 2021 23:32
@joshhunt joshhunt force-pushed the joshhunt/azure-select-logs-resource-groups branch from b2e0aa4 to 8e7b460 Compare May 27, 2021 23:32
@joshhunt joshhunt disabled auto-merge May 28, 2021 07:58
@joshhunt joshhunt merged commit 888cddb into main May 28, 2021
@joshhunt joshhunt deleted the joshhunt/azure-select-logs-resource-groups branch May 28, 2021 07:58
grafanabot pushed a commit that referenced this pull request May 28, 2021
…ogs (#34766)

* AzureMonitor: Support querying Subscriptions and Resource Groups in Logs

* cleanup

(cherry picked from commit 888cddb)
joshhunt added a commit that referenced this pull request May 28, 2021
…ogs (#34766) (#34875)

* AzureMonitor: Support querying Subscriptions and Resource Groups in Logs

* cleanup

(cherry picked from commit 888cddb)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
@hugohaggmark hugohaggmark changed the title AzureMonitor: Support querying Subscriptions and Resource Groups in Logs AzureMonitor: Support querying subscriptions and resource groups in Azure Monitor Logs Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to changelog area/frontend datasource/Azure Azure Monitor Datasource old backport v8.0.x Mark PR for automatic backport to v8.0.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow selecting Azure subscription as scope instead of workspaces only
4 participants