10 Commits

Author SHA1 Message Date
68cbd23916 Chore: reduces barrel files (#107512)
* Chore: reduce barrel files

* chore: fixes unit test

* chore: fix broken path
2025-07-07 09:23:27 +02:00
4020a3d96a Azure: Fix resource name determination in template variable queries (#105705)
* Correctly parse resource URIs

* Update test

* Update variable function
2025-06-18 16:02:40 +01:00
c7b0bbd262 Azure: Variable editor and resource picker improvements (#101695)
* Update namespace endpoint to filter out only relevant namespaces

* Update tests

* Fix url builder tests

* Add todo comments

* Update func to use ARG to retrieve namespaces with metrics

* Refactor getMetricNamespaces for readability

* Lint

* Remove comments

* Remove type assertion

* Refactor ARG query

* Update tests and refactor class to use ARG

* Update resource group query

- Updates the resource groups query to support users/apps with restricted permissions

* Update resources request to be paginated

- Also order by name
- Add tests

* Start refactoring azure monitor util functions to resource graph

* Minor lint

* Add getMetricNamespaces resource graph function

* Modify getMetricNamespaces call

- Use resource graph function for variable queries

* Return names for getResourceNames values

* Use getMetricNamespaces variable specific req in editor

* Substantial refactor

- Update Azure Resource Graph data source with a method for making paged requests and a method for retrieving metric namespaces (and add tests)
- Extract helpers from azure_monitor_datasource to utils and generalise them (also revert previous changes to datasource and test file)
- Update mock with Azure Resource Graph data source
- Revert response parser changes
- Revert url builder changes
- Update get metric namespaces query to use the resource graph method for variable queries
- Update docs

* Lint

* Oops

* Fix type

* Lint and betterer

* Simplify imports

* Improve type

* Simplify resource picker class

* Start updating tests

* Fix naming and include missing error

* Update resource graph data source mock

* Update tests

* Remove unneeded parser

* Add get subscriptions to resource graph

* Generalise resource groups request

* Fix resource names request to ensure no clashing

* Update types

* Use resource graph queries for resource picker

* Correctly map resource group names

* Update mocks

* Update tests

* Fix mapping

* Refactor getResourceNames

- Remove most of the logic from resourcePickerData
- Add helper for parsing resource names as template vars
- Some renames for clarity
- Update types
- Update tests

* Ensure namespaces are lowercase

* Update docs/sources/datasources/azure-monitor/template-variables/index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Prettier write

* Ensure we return all namespaces if resourceGroup isn't specified

---------

Co-authored-by: alyssabull <alyssabull@gmail.com>
Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>
2025-03-06 21:08:35 +02:00
4c5a906c83 Azure Monitor: Filter namespaces by resource group (#100325) 2025-03-06 11:41:24 -07:00
e01d8ad5b5 Azure: Add support for custom namespace and custom metrics variable queries (#99279)
* Add custom metric namespace and metric name queries

* Fix outdated type

* Support specifying custom

- Add custom support to getMetricNamespaces
- Ensure the customNamespace is specified in getMetricNames calls

* Update data source tests

* Support custom namespace/metrics variable queries

- Add tests

* Add fields to variable editor

- Update tests
- Update docs
- Update selectors

* Remove unneeded Promise.resolve

* Add comment

* Don't mutate expected path

* Lint

* Update docs/sources/datasources/azure-monitor/template-variables/index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Update docs/sources/datasources/azure-monitor/template-variables/index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Update docs

* Update conditionals

* Lint

---------

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>
2025-01-27 15:53:00 +00:00
3ea6d1f7cc AzureMonitor: Remove dependencies on Grafana frontend (#75595)
* remove local graf templateSrv and use @grafana/runtime

* tests broken still 0.0

* wip

* moving around tests and fixing

* template var test using mocking and stuff

* AM ds tests fixed

* fix filter tests

* all tests work

* remove comment

* Update azure_log_analytics_datasource.ts

* remove deferred util - not used

* mock instead of spying

* not calling getTemplateSrv each time

* pass range down to filter instead of doing werid stuff

* use default time range if no time range

* prettierer

* remove note
2023-10-04 09:25:05 -05:00
f6f47678a4 QueryRunners: Bind the query function where it is passed on (#73399) 2023-09-18 17:00:43 +02:00
51b199e986 AzureMonitor: revert Variable Editor region changes (#72306)
* Revert "remove regions/locations from variable editor"

This reverts commit 41dc6a8bfb5dd90d56c108f7d76d20d79011d51a.

* Revert "remove region pieces from e2e"

This reverts commit 6b1f82f14a2f4f7338f5ad4b84a89c0e375e7348.

* e2e: open resource picker correctly
2023-07-26 14:04:18 +00:00
722f787eaa AzureMonitor: Fix ResourcePicker hanging (#71886)
* AzureMonitor: Fix ResourcePicker hanging

Removed location fetching for every subscription.

Fixes #70523

* fix region for multi metricnames

* fix tests

* fix e2e

* remove regions/locations from variable editor

* remove region pieces from e2e
2023-07-25 14:18:03 +00:00
d7f7cd1e61 Schema: Initial Azure Monitor query schema (#62018)
* Initial schema

- Add types based off of current frontend

* Rename and field-level comments

* Update report and regenerate files

* Rename frontend Azure folder

- Doing this for consistency and to ensure code-generation works
- Update betterer results due to file renames

* Remove default and add back enum vals that I deleted

* Set workspace prop as optional

* Replace template variable types

* Connect frontend query types

- Keep properties optional for now to avoid major changes
- Rename AzureMetricResource
- Correctly use ResultFormat

* Add TSVeneer decorator

* Update schema

* Update type

* Update CODEOWNERS

* Fix gen-cue issue

* Fix backend test

* Fix e2e test

* Update code coverage

* Remove references to old Azure Monitor path

* Review

* Regen files
2023-02-03 16:06:54 +00:00