Google Cloud Spanner Query-Level Metrics#24565
Conversation
- Add metadata.csv with 10 spanner.queries.* metrics - Add assets/service_checks.json (empty) - Add assets/configuration/spec.yaml with full config schema - Generate conf.yaml.example and config_models/ via ddev - Update manifest.json: add app_uuid, owner, fix metrics prefix to spanner.* - Update pyproject.toml Development Status from Alpha to Beta - Add README.md with beta notice, setup instructions, and tile sections - Fix ruff formatting across all Python files in the integration Environment: Datadog workspace Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b10a86a46b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Created DOCS-15122 for the editorial review. |
Validation Report
Run Passed validations (16)
|
- pyproject.toml: move google-cloud-spanner and google-auth from project.dependencies to project.optional-dependencies.deps so the hatch env feature `deps` is defined (fixes py3.13 test env). - manifest.json: add tile.changelog, tile.media, and assets.integration.auto_install (fixes validate-manifests/logs/assets). - CHANGELOG.md + changelog.d/24565.added: new scaffold and initial entry (fixes Check PR changelog and version validator). - labeler.yml: register integration/cloud_spanner (ddev validate labeler --sync). - License headers on all cloud_spanner *.py files (ddev validate license-headers --fix). - agent_requirements.in + LICENSE-3rdparty.csv: sync google-auth and google-cloud-spanner (ddev dep freeze). Environment: Datadog workspace Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… base package pins. The uv resolver in CI failed because google-auth==2.38.0 caps cachetools at <6.0, but datadog-checks-base pins cachetools==7.0.5. The cachetools cap was dropped in google-auth 2.48.0. google-cloud-spanner==3.48.0 also caps protobuf at <6.0.0dev while the base package pins protobuf==7.34.0. protobuf >=4.25.8, <8 support was added in google-cloud-spanner 3.65.0. - google-auth: 2.38.0 -> 2.56.0 - google-cloud-spanner: 3.48.0 -> 3.69.0 Verified with `pip install --dry-run` against the full base-package deps set (cachetools==7.0.5, protobuf==7.34.0, mmh3==5.2.1, etc.) that the resolver finds a valid solution. Environment: Datadog workspace Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The datadog-assets validator expects sample_tags values to be comma-separated, wrapped in double quotes (per other integrations like anthropic_usage_and_costs). The previous space-separated form failed validate-metrics_metadata for all 10 spanner.queries.* rows. Environment: Datadog workspace Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The wheel-builder workflow (resolve-build-deps.yaml) installs host_dependencies.txt on each runner. google-cloud-storage transitively pulls in google-auth (>=2.48.0), which hard-requires cryptography>=38.0.3. Unpinned, pip picks cryptography 49.0.0 — which dropped macos-x86_64 wheels — and falls back to a source build that fails on the macos-x86_64 runner because Homebrew (and thus OpenSSL) was removed as part of runner setup. This has been failing on every PR that touches agent_requirements.in since cryptography 49.0.0 released 2026-06-12. Not a cloud_spanner issue, but it blocks this PR because the earlier commits added google deps to agent_requirements.in, causing the wheel-builder to actually run. cryptography 48.x still ships universal2 wheels that cover x86_64. Environment: Datadog workspace Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
buraizu
left a comment
There was a problem hiding this comment.
Looks good overall, just suggesting a few minor updates for the doc
| @@ -0,0 +1,64 @@ | |||
| ## Overview | |||
|
|
|||
| > **Note:** This integration is in beta. Features and configuration options may change. | |||
There was a problem hiding this comment.
| > **Note:** This integration is in beta. Features and configuration options may change. | |
| > **Note:** This integration is in preview. Features and configuration options may change. |
|
|
||
| ### Prerequisites | ||
|
|
||
| - A Google Cloud service account with the `spanner.databases.select` permission, or Application Default Credentials (ADC) when running inside GCP |
There was a problem hiding this comment.
| - A Google Cloud service account with the `spanner.databases.select` permission, or Application Default Credentials (ADC) when running inside GCP | |
| - A Google Cloud service account with the `spanner.databases.select` permission, or Application Default Credentials (ADC) when running inside Google Cloud |
| ## Data Collected | ||
|
|
||
| ### Metrics | ||
|
|
||
| See [metadata.csv][6] for a list of metrics provided by this integration. | ||
|
|
||
| ### Service Checks |
There was a problem hiding this comment.
| ## Data Collected | |
| ### Metrics | |
| See [metadata.csv][6] for a list of metrics provided by this integration. | |
| ### Service Checks | |
| ## Data collected | |
| ### Metrics | |
| See [metadata.csv][6] for a list of metrics provided by this integration. | |
| ### Service checks |
What does this PR do?
This introduces a new integration:
cloud_spanner. This integration adds query-level metrics for Spanner databases by connecting to the DB and querying tables in theSPANNER_SYSschema.This integration should be seen as experimental until otherwise communicated.
Motivation
Today, Datadog collects various metrics for Spanner databases, but it does it via the GCP API. This limits what data is available. For example, query metrics are aggregated across all queries, and a per-query breakdown is not supported.
Query-Level Metrics are a staple of Database Monitoring, so we can support a Database Monitoring experience for Spanner by collecting and sending them.
Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged