Skip to content

feat(cloud-query): add Azure integration with support for metrics and logs queries#3421

Open
floreks wants to merge 11 commits intomasterfrom
sebastian/prod-4571-add-azure-metrics-integration-for-cloud-query
Open

feat(cloud-query): add Azure integration with support for metrics and logs queries#3421
floreks wants to merge 11 commits intomasterfrom
sebastian/prod-4571-add-azure-metrics-integration-for-cloud-query

Conversation

@floreks
Copy link
Copy Markdown
Member

@floreks floreks commented Apr 13, 2026

This pull request adds support for Azure Monitor as a configurable tool in the workbench, enabling users to connect to Azure and query metrics and logs from Azure resources. The changes span the frontend, backend Go models, GraphQL schema, and documentation to fully integrate Azure as a first-class observability integration.

The most important changes are:

Frontend integration and configuration:

  • Added WorkbenchToolType.Azure throughout the frontend, including configuration forms, tool type lists, labels, categories, and icon mapping in WorkbenchToolForm.tsx and workbenchToolsUtils.tsx.
  • Implemented AzureFormFields in WorkbenchToolFormFields.tsx to collect Azure credentials and resource information from the user.

Backend Go model and API updates:

  • Added new Go types for Azure connections and configuration attributes, and updated the tool type enum and validation logic to include Azure in models_gen.go.

GraphQL and gRPC/protobuf support:

  • Extended the GraphQL schema to expose Azure connection fields in workbench.graphql.
  • Updated toolquery.proto to add AzureConnection, support Azure as a ToolConnection, and introduced Azure-specific options for metrics queries.

Documentation:

  • Updated API reference (docs/api-reference.md) and README to document Azure Monitor support, required credentials, query options, and usage details.

These changes collectively enable users to configure and use Azure Monitor as an observability tool within the workbench, with full support across the stack.

Test Plan

Locally and on dev env

Checklist

  • If required, I have updated the Plural documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a meaningful title and summary to convey the impact of this PR to a user.

Plural Flow: console

@linear
Copy link
Copy Markdown

linear bot commented Apr 13, 2026

@floreks floreks self-assigned this Apr 13, 2026
@floreks floreks added the enhancement New feature or request label Apr 13, 2026
@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 13, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgithub.com/​pluralsh/​console/​go/​client@​v1.56.010010010010070
Addedgithub.com/​grpc-ecosystem/​go-grpc-middleware/​v2@​v2.3.399100100100100
Addedgithub.com/​grpc-ecosystem/​go-grpc-middleware/​providers/​prometheus@​v1.1.0100100100100100

View full report

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 13, 2026

Greptile Summary

This PR adds Azure Monitor as a first-class workbench observability integration across the full stack — Go gRPC provider, Elixir schema/conversion/tool modules, GraphQL schema, and React form components. A number of earlier review concerns have been addressed: the logs[:limit] bounds-check panic is fixed, metrics_namespace is now properly surfaced through per-query options, and the orphaned resourceId form field has been removed.

Two Go-side P2 items remain: the ISO 8601 duration regex is compiled on every metrics call (should be a package-level var), and the regex currently accepts the degenerate values \"P\" and \"PT\" which are not valid durations.

Confidence Score: 4/5

Not safe to merge until the Go compilation errors flagged in previous review rounds are resolved; once those are fixed, only minor P2 concerns remain.

New findings in this pass are all P2 (regex efficiency and edge-case validation). However, multiple Go compile-time errors raised in prior review rounds — new() used with value arguments in provider_azure.go (lines 93, 136) and datasource/azure.go (lines 63–69) — are still present in the HEAD commit, meaning the Go binary cannot be built as-is. Those blockers keep the score at 4 rather than 5.

go/cloud-query/internal/tools/provider_azure.go and go/cloud-query/internal/tools/datasource/azure.go for unresolved compilation errors from prior review rounds.

Important Files Changed

Filename Overview
go/cloud-query/internal/tools/provider_azure.go New Azure provider implementing Metrics, MetricsSearch, and Logs; still contains previously-flagged compile-time errors (new() with value arguments on lines 93 and 136).
go/cloud-query/internal/tools/datasource/azure.go Azure datasource implementation; previously-flagged new() compile errors remain on lines 63–69; also contains a regex compiled on every call and an ISO 8601 validator that accepts degenerate inputs.
go/cloud-query/internal/tools/client/azure.go Azure SDK client wrapper; creates new SDK client objects on every Logs/Metrics/MetricsSearch call rather than caching them in the struct.
lib/console/ai/tools/workbench/observability/metrics.ex Adds per-query Azure metrics options (resource_id, metrics_namespace, aggregation, etc.) as an embedded schema; previously-missing metrics_namespace is now properly populated from per-query input.
lib/console/schema/workbench_tool.ex Adds azure: 13 to the Tool enum and an AzureConnection embed with the four required credential fields; changeset validates all four are required.
lib/console/ai/tools/workbench/observability/logs.ex Adds per-query Azure logs options (resource_id) as an embedded schema; correctly passes it to the gRPC backend.
assets/src/components/workbenches/tools/WorkbenchToolFormFields.tsx AzureFormFields component collects Subscription ID, Tenant ID, Client ID, and Client Secret; orphaned Resource ID field has been removed.
assets/src/components/workbenches/tools/WorkbenchToolForm.tsx Adds Azure to INITIAL_TOOL_CONFIG_BY_TYPE with only the four valid credential fields; previously-problematic resourceId field has been removed.

Reviews (6): Last reviewed commit: "refactor: remove `resourceId` field from..." | Re-trigger Greptile

Comment thread go/cloud-query/internal/tools/provider_azure.go Outdated
Comment thread go/cloud-query/internal/tools/provider_azure.go
Comment thread go/cloud-query/internal/tools/datasource/azure.go
Comment thread go/cloud-query/internal/tools/provider_azure.go Outdated
@floreks
Copy link
Copy Markdown
Member Author

floreks commented Apr 13, 2026

@greptileai there are no compilation failures. new is used correctly according to new Go 1.26 syntax. Remember this and review again.

Comment thread go/cloud-query/internal/tools/datasource/azure.go Outdated
@floreks
Copy link
Copy Markdown
Member Author

floreks commented Apr 13, 2026

@greptileai review

Comment thread lib/console/graphql/deployments/workbench.ex Outdated
@floreks
Copy link
Copy Markdown
Member Author

floreks commented Apr 13, 2026

@greptileai review

Comment thread lib/console/ai/tools/workbench/observability/metrics.ex Outdated
@floreks
Copy link
Copy Markdown
Member Author

floreks commented Apr 13, 2026

@greptileai Remember about go 1.26 language changes

Changes to the language
The built-in new function, which creates a new variable, now allows its operand to be an expression, specifying the initial value of the variable.

This feature is particularly useful when working with serialization packages such as encoding/json or protocol buffers that use a pointer to represent an optional value, as it enables an optional field to be populated in a simple expression

Review again.

Comment thread assets/src/components/workbenches/tools/WorkbenchToolFormFields.tsx
Comment thread assets/src/components/workbenches/tools/WorkbenchToolForm.tsx
@floreks
Copy link
Copy Markdown
Member Author

floreks commented Apr 13, 2026

@greptileai review

Comment thread lib/console/ai/tools/workbench/observability/metrics.ex
…support, remove provider-specific options from default schemas
@michaeljguarino
Copy link
Copy Markdown
Member

@floreks looks like there's a fair number of merge conflicts here

…-add-azure-metrics-integration-for-cloud-query
@floreks
Copy link
Copy Markdown
Member Author

floreks commented Apr 17, 2026

resolved conflicts

@floreks
Copy link
Copy Markdown
Member Author

floreks commented Apr 17, 2026

This will need to be adjusted to the latest workbench frontend changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants