Repository navigation
Rename Google Stackdriver operators and hook to Cloud Monitoring - #73354
Merged
potiuk merged 7 commits intoSep 22, 2026
Merged
Conversation
shahar1
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496,
jscheffl and
potiuk
as code owners
September 18, 2026 18:22
shahar1
marked this pull request as draft
September 18, 2026 18:36
shahar1
marked this pull request as ready for review
September 18, 2026 18:54
Contributor
Author
|
CC: @VladaZakharova @MaksYermak @jroachgolf84 @SameerMesiah97 |
shahar1
commented
Sep 18, 2026
SameerMesiah97
left a comment
Contributor
There was a problem hiding this comment.
This is a large PR so I will review the tests in a second pass. I have left some comments.
Google retired the "Stackdriver" brand years ago. The hook, operators and links in this module only call the Cloud Monitoring API v3 (alert policies and notification channels), so they are renamed to match. The old Stackdriver-prefixed classes remain as deprecated aliases until March 31, 2027, per the provider's deprecation policy. Part of the rename tracked in apache#61009.
The rename commit reused the old Stackdriver cube for the Cloud Monitoring integration logo. Google distributes a product-specific Cloud Monitoring icon in the "Legacy console icons" set on https://cloud.google.com/icons, which is the same set the other Google provider logos come from, so use that one instead.
The deprecated alias modules only re-exported the renamed classes, so names that used to live alongside them disappeared: the three STACKDRIVER_* link URL constants, and the hook and link classes that were importable from the operators module. Anyone importing those got an ImportError rather than a deprecation warning, which defeats the point of keeping the old modules around. The published operators/cloud/stackdriver.html page also had no redirect to its new location.
The compatibility shim re-exported only the hook and link classes, so a Dag importing GoogleCloudBaseOperator, PROVIDE_PROJECT_ID, AlertPolicy, NotificationChannel or the gapic DEFAULT sentinel from the Stackdriver operators module would fail to parse on upgrade instead of warning. The link identity check could not fail either: the deprecated classes inherit name and key from their replacements, so comparing the two always held. Pinning the literal values guards the invariant that already-serialized Dags and stored XComs resolve their extra links by name and key.
GoogleBaseHook resolves its connection in __init__, so instantiating the deprecated hook looked up google_cloud_default and failed whenever the test ran without a database. Stubbing the lookup keeps the check on what it is meant to cover — that the alias still warns and still is the new hook.
The notification-channel operators, and their hook methods, described "alert policies" or "alerts" in several docstrings instead of notification channels (summaries, :param filter_:, :param project_id:, :param channels:, :param name:). One :param project_id: described a location instead of a project. The docs page also pasted the same "fetch all the alert policies" usage line under all nine operator sections regardless of what the operator does, said "the give name" instead of "the given name", and left the delete-notification-channel section without the intro sentence every other section has. These are pre-existing copy-paste defects carried over verbatim from the Stackdriver modules by the mechanical rename, surfaced in review. Docs, docstrings and prose only - no behaviour change.
The enable and list notification-channel tasks filtered on type="pubsub", so they acted on every Pub/Sub channel in the project rather than the two channels the Dag creates, and the list alert policies task had no filter at all. Both now filter on the display names the Dag generates, matching the enable and disable alert-policy tasks.
shahar1
force-pushed
the
rename-google-stackdriver-monitoring
branch
from
September 21, 2026 06:49
b3a95bc to
2d71c33
Compare
5 tasks
MaksYermak
approved these changes
Sep 21, 2026
1 task done
potiuk
approved these changes
Sep 22, 2026
This was referenced Sep 22, 2026
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renames the Google provider's Stackdriver hook, operators and links to Cloud Monitoring, matching the
API they call. Old class names remain as deprecated aliases (planned removal March 31, 2027).
Part of the rename tracked in #61009. The task log handler follows in a separate PR.
This also removes an unreachable
except HttpErrorclause indelete_alert_policyanddelete_notification_channelthat re-raised asAirflowException. It was left over from before thegapic migration: the underlying
monitoring_v3.AlertPolicyServiceClient/NotificationChannelServiceClientare gRPC clients that raisegoogle.api_core.exceptions.*, nevergoogleapiclient.errors.HttpError, so the clause never matched. Callers — including user retry andfailure callbacks reading
context["exception"]— already saw the rawgoogle.api_coreexceptionbefore this change, so there is no observable behaviour change.
related: #61009
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Sonnet 5) following the guidelines