Skip to content

Rename Google Stackdriver operators and hook to Cloud Monitoring - #73354

Merged
potiuk merged 7 commits into
apache:mainfrom
shahar1:rename-google-stackdriver-monitoring
Sep 22, 2026
Merged

potiuk merged 7 commits into
apache:mainfrom
shahar1:rename-google-stackdriver-monitoring

Conversation

@shahar1

@shahar1 shahar1 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

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 HttpError clause in delete_alert_policy and
delete_notification_channel that re-raised as AirflowException. It was left over from before the
gapic migration: the underlying monitoring_v3.AlertPolicyServiceClient /
NotificationChannelServiceClient are gRPC clients that raise google.api_core.exceptions.*, never
googleapiclient.errors.HttpError, so the clause never matched. Callers — including user retry and
failure callbacks reading context["exception"] — already saw the raw google.api_core exception
before this change, so there is no observable behaviour change.

related: #61009


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Sonnet 5)

Generated-by: Claude Code (Sonnet 5) following the guidelines

@shahar1

shahar1 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor Author

CC: @VladaZakharova @MaksYermak @jroachgolf84 @SameerMesiah97
- I'll appreciate your reviews to ensure that I don't break anything :)

Comment thread generated/known_airflow_exceptions.txt Resolved

@SameerMesiah97 SameerMesiah97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.
@potiuk
potiuk merged commit df4b129 into apache:main Sep 22, 2026
156 checks passed
@shahar1
shahar1 deleted the rename-google-stackdriver-monitoring branch September 22, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers kind:documentation provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants