Repository navigation
Description
Goal
Give a new contributor everything needed to independently develop, test,
document, and provide completion evidence for:
- The BQAA Grafana dashboard.
- The BQAA Claude Code tracing plugin.
Use only synthetic data and an approved non-production GCP project. Production
data, production credentials, repository administration, and release secrets
are out of scope for the contributor.
Current state (2026-09-04)
Grafana
- Core implementation landed in PR #373.
- Local one-command setup landed in PR #422.
- Query and public-demo hardening landed in PR #433.
- Issue #339 remains open.
- The remaining assignment should focus on clean-environment validation,
documentation corrections, defects found during testing, evidence, and
tracker closure—not rebuilding the dashboard.
Claude Code plugin
- The hook implementation, plugin build, and in-repository marketplace exist.
plugins/claude_code/
is the plugin wrapper and documentation.- The canonical Python implementation is under
producers/src/bigquery_agent_analytics_tracing/.
Do not implement Python behavior in a generated plugin copy. - The producer source version is
0.2.0, while the checked-in marketplace
distribution is still0.1.0. - PyPI and release prerequisites remain tracked by
#349
and the canonical operator checklist in
#353.
Maintainer: complete before assigning work
- Record contributor GitHub handle:
@<handle>. - Assign a technical owner:
@<owner>. - Assign a reviewer who can approve and merge PRs:
@<reviewer>. - Confirm whether the contributor uses a fork or may push feature branches.
- Confirm the Google CLA is satisfied.
- Provide an approved, billing-enabled, non-production GCP project.
- Create or identify a disposable BigQuery dataset.
- Confirm who owns Grafana Cloud access and public-sharing permission.
- Confirm whether Claude Code marketplace testing is included.
- Confirm whether the assignment stops at release readiness or includes
operating the0.2.0release. - Keep Google-internal links, email addresses, credentials, and access
tickets out of this public issue.
Shared workstation requirements
The contributor needs:
- Git and GitHub CLI.
- Python 3.12 preferred; the packages support Python 3.10–3.14.
- An isolated Python virtual environment.
- Google Cloud CLI, including
gcloudandbq. - Access to the approved GCP sandbox project.
- No production access.
Start with:
gh auth status
git clone https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK.git
cd BigQuery-Agent-Analytics-SDK
python3.12 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -e ".[dev]"Read before contributing:
Workstream A — Grafana dashboard
A1. Learn the component
Read these in order:
- Grafana README
- Query conventions and file-to-panel map
- Public-demo query rules
- Interactive dashboard JSON
- Public-demo dashboard JSON
- Datasource provisioning example
Important concepts:
queries/*.sqlis the source of truth.- Grafana JSON embeds a copy of each SQL query.
- Change the SQL file first, then update the matching dashboard panel.
- Interactive identifiers and prices must remain
Constantvariables. - Public-demo queries must have no Grafana variables or macros and must retain
the half-open 72-hour limit. - Never add Trace Detail or real production identifiers to the public demo.
A2. Obtain test resources
Required:
- An approved test GCP project.
- A disposable BigQuery dataset.
- BigQuery API and Cloud Resource Manager API enabled.
- Application Default Credentials for local testing.
- Grafana Cloud Free with dashboard-editor/public-sharing permission, or local
Grafana for initial work. - Google BigQuery datasource plugin.
For local ADC:
gcloud auth application-default login
gcloud config set project TEST_PROJECTFor a Grafana service account:
roles/bigquery.jobUseron the query project.roles/bigquery.dataVieweron the test dataset only.- Do not grant Owner or Editor.
- Never commit a JSON key.
- Use a separate demo-only identity for a publicly shared dashboard.
References:
A3. Create safe test data
bqaa seed-events \
--scenario retail-returns \
--project-id TEST_PROJECT \
--dataset-id TEST_DATASET \
--events-table agent_events \
--sessions 100
bq-agent-sdk views create-all \
--project-id TEST_PROJECT \
--dataset-id TEST_DATASET \
--table-id agent_eventsVerify that the table is non-empty and recent:
bq query --use_legacy_sql=false \
'SELECT COUNT(*) AS events, MAX(timestamp) AS latest
FROM `TEST_PROJECT.TEST_DATASET.agent_events`'A4. Run and inspect the dashboard locally
python3 grafana/run_local.py \
--project TEST_PROJECT \
--dataset TEST_DATASETVerify:
- All dashboard rows and panels load without query errors.
- Agent, User ID, Event Type, and Session filters behave as documented.
- Clicking a recent session drives Trace Detail.
- Empty filter intersections show an honest no-data state.
- Token, latency, error, and estimated-cost panels have sensible values.
- The datasource retains the configured
MaxBytesBilledlimit. - No service-account credential appears in Git output.
Stop the local instance afterward:
python3 grafana/run_local.py --stopA5. Make and validate changes
When changing a panel:
- Edit its canonical
.sqlfile. - Paste the identical query into the matching dashboard JSON panel.
- If adding a panel, update the appropriate mapping in
scripts/check_grafana_queries_sync.py. - Update the documented file-to-panel map.
- If it belongs in the public demo, create the separate bounded query under
queries/public-demo/.
Run:
python3 scripts/check_grafana_queries_sync.py
python3 -m pytest -q tests/test_grafana_local_runner.pyBoth must pass before opening a PR.
A6. Validate public sharing
Use only a dedicated synthetic dataset. Verify in an incognito/logged-out
browser:
- The dashboard loads without authentication.
- Every panel is inspected for query errors.
- The time picker is hidden and locked.
- Queries cannot exceed the fixed 72-hour window.
- Trace Detail is absent.
- No real user IDs, prompts, responses, credentials, project names, or
sensitive error messages appear. - A per-query byte cap and a BigQuery project quota are configured.
- The public link can be paused or revoked.
Do not post a sensitive public dashboard URL in this issue.
A7. Grafana completion evidence
Post:
- Commit or PR link.
- Automated test output.
- Grafana and BigQuery plugin versions.
- Confirmation that synthetic data was used.
- Confirmation that every panel passed.
- Confirmation that incognito public-share validation passed.
- Any documentation corrections.
- Cleanup and link-revocation confirmation.
Done when the maintainer reconciles this evidence with #339 and closes or
narrows that tracker.
Workstream B — Claude Code tracing plugin
B1. Learn which files are source and which are generated
Read:
- Plugin README
- Marketplace and IAM checklist
- Plugin manifest
/bqaa-setupcommand- Producer package README
- Plugin build script
- Release runbook
- Claude marketplace catalog
Rules:
- Python behavior belongs in
producers/src/bigquery_agent_analytics_tracing/. plugins/claude_code/vendor/is generated and gitignored. Never edit it
manually.plugins/claude_code_dist/is a released artifact, not canonical source.0.0.0+localin the source manifest is intentional; the build stamps the
release version.- Build in a disposable checkout or worktree because the build stamps the local
manifest and generates vendor files.
B2. Install development dependencies
Required:
- Current Claude Code CLI and an approved Claude entitlement.
- Python 3.12 development environment.
- GCP sandbox project and dataset for live smoke testing.
google-cloud-bigquery.google-cloud-bigquery-storageandpyarrowfor the preferred Storage Write
path.
cd producers
python3.12 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -e ".[dev,receiver,storage-write]"
claude --versionReferences:
B3. Run automated checks
cd producers
isort --check-only src/ tests/ scripts/
pyink --check src/ tests/ scripts/
python3 -m pytest -qFor focused plugin work, at minimum run:
python3 -m pytest -q \
tests/test_claude_code.py \
tests/test_setup_check.py \
tests/test_build_claude_plugin.py \
tests/test_drain.py \
tests/test_logger_row_shape.pyB4. Build and validate the plugin artifact
Follow the same sequence as CI:
cd producers
python3 -m pip install --require-hashes -r build-requirements.lock
python3 -m build --no-isolation
python3 -m pip install --no-deps \
dist/bigquery_agent_analytics_tracing-*.whl
python3 scripts/build_claude_plugin.py
cd ..
claude plugin validate plugins/claude_code --strict
claude plugin validate . --strictInspect the generated tarball and confirm it contains:
.claude-plugin/plugin.jsonwith the release version.- All nine hook scripts plus
common.sh. commands/bqaa-setup.md.scripts/run_setup_check.sh.- Vendored package source.
- Matching
.dist-info/METADATA. - No
__pycache__,.pyc, credentials, or local configuration.
B5. Test safely before connecting BigQuery
Start with dry-run mode:
export BQAA_PROJECT_ID=TEST_PROJECT
export BQAA_DATASET=TEST_DATASET
export BQAA_PYTHON="$(command -v python3)"
export BQAA_AGENT_NAME=vendor-plugin-smoke
export BQAA_DRY_RUN=true
export BQAA_TRACE_ENABLED=true
claude --plugin-dir plugins/claude_codeInside Claude Code, run /bqaa-setup, then submit a harmless test prompt and
verify the dry-run log and spool behavior. The plugin must never break the
Claude Code session when tracing fails.
B6. Run the BigQuery smoke test
The test identity requires:
roles/bigquery.dataEditoron the destination dataset.roles/bigquery.useron the project.roles/bigquery.metadataVieweron the dataset when auto-creating the table.
Use a pre-created dataset where possible. Disable dry-run, launch a fresh Claude
Code session, run /bqaa-setup, and submit one harmless prompt.
Verify rows:
SELECT
event_type,
JSON_VALUE(attributes, '$.writer.version') AS writer_version,
JSON_VALUE(attributes, '$.writer.label') AS writer_label,
agent,
timestamp
FROM `TEST_PROJECT.TEST_DATASET.agent_events`
WHERE agent = 'vendor-plugin-smoke'
ORDER BY timestamp DESC
LIMIT 20;Expected:
- Hook rows arrive.
writer_versionmatches the built artifact and is not0.0.0+local.- Only one BQAA plugin installation is active; duplicate installations cause
duplicate telemetry. - Setting
BQAA_TRACE_ENABLED=falseand restarting Claude Code produces no new
rows and no agent error.
B7. Validate the marketplace path
Before testing, run /plugin list and remove or disable older BQAA plugin
installations.
Validate the current Git-based install path:
/plugin marketplace add GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK --sparse .claude-plugin plugins/claude_code_dist
/plugin install bigquery-agent-analytics-tracing@bqaa-tracing
/bqaa-setup
Add the marketplace using owner/repository, not a direct URL to
marketplace.json, because its plugin source is a relative repository path.
For a 0.2.0 release, repeat this smoke only after the checked-in distribution
and catalog have been refreshed from the final built artifact.
B8. Claude Code completion evidence
Post:
- Commit or PR link.
- Claude Code and Python versions.
- Full and focused test results.
claude plugin validate --strictoutput.- Tarball inventory and version.
/bqaa-setupREADY result.- Redacted BigQuery query result proving the writer version.
- Kill-switch test result.
- Confirmation that duplicate plugins were removed.
- Confirmation that only synthetic or non-sensitive prompts were used.
- Remaining release blockers requiring a maintainer.
Google-maintainer-only actions
Do not assign these actions to the contributor unless they explicitly have the
required authority:
- Repository settings, Actions environments, variables, and secrets.
- Creating or configuring
tracing-testpypi,tracing-pypi, and
release-promote. - PyPI/TestPyPI Trusted Publisher configuration and adding second Owners.
- Organization-owned GitHub App creation and installation.
- Repository immutable-release setting changes.
- Creating or pushing the protected
tracing-v0.2.0tag. - Approving release promotion and PyPI deployment.
- Artifact Registry, WIF, or public receiver-image administration when Release bigquery-agent-analytics-tracing 0.2.0: publish the Claude/Codex OTel admin stack to PyPI #349 is
included. - Final Anthropic official-marketplace submission.
The authoritative operator checklist is
#353.
The contributor may prepare artifacts, smoke evidence, and PRs, but a designated
Google maintainer must perform and record privileged steps.
Overall definition of done
- Contributor can reproduce both components from a clean checkout.
- Automated tests and strict manifest validation pass.
- Grafana works locally with synthetic data.
- Grafana public-demo safety is verified in an incognito session.
- Claude plugin produces correctly versioned test rows.
- Claude plugin kill switch works.
- No credentials or production data are committed or exposed.
- Documentation is accurate for a first-time user.
- All contributor-executable evidence is attached.
- Maintainer-only blockers are explicitly handed to an owner.
- Parent trackers are reconciled and closed or narrowed.
Activity
caohy1988 commentedon Sep 4, 2026
Hard resource requirements for the contributor
This is the concrete provisioning checklist. It covers accounts, machines,
software, cloud resources, APIs, IAM, and credentials. The longer task and
validation instructions remain in the issue body.
Shared resources required for both workstreams
Contributor workstation
Linux environment such as WSL; the repository scripts and plugin hooks
use Bash.
Grafana download/plugin endpoints, and Anthropic/Claude endpoints.
environments, Grafana download, plugin builds, and test artifacts.
Source-control access
gh) installed and authenticated.GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK(the repository ispublic).
does not require repository-admin access.
Common local tools
python3,pip, andvenvavailable.gcloudandbq.committed to the repository.
Project A — Grafana dashboard resources
A. Google Cloud resources
USor
EU.bigquery.googleapis.com.cloudresourcemanager.googleapis.com.bqaaandbq-agent-sdkcommands areavailable.
agent_eventstable created withbqaa seed-events.bq-agent-sdk views create-all.timestampso Grafana time filters prunescans.
Recommended test allocation:
bqaa_grafana_vendor_testor another disposable approved name.agent_events.retail-returnssessions.requests that it remain for regression testing.
B. Local authentication for the one-command runner
gcloud auth application-default login.C. Grafana runtime
At least one of the following is required:
Local validation path
grafana/run_local.py.3000.127.0.0.1; no public ingress is needed.Hosted validation/public-share path
The current BigQuery plugin requires a compatible Grafana release. The
repository runner pins a tested Grafana and plugin combination; use the runner
unless a specific hosted version must be tested.
D. BigQuery identity used by Grafana
authentication identity.
roles/bigquery.jobUseron the query project.roles/bigquery.dataVieweron the test dataset only.service-account JSON key.
after Grafana has been configured.
Do not grant Project Owner, Editor, or project-wide BigQuery Data Viewer.
E. Additional public-demo resources
MaxBytesBilledconfigured; the repository exampleuses a 100 MB per-query cap for the small demo dataset.
verification.
F. Optional resources
grafana/run_local.pyor Grafana Cloud.Grafana. A committed datasource key is never acceptable.
Grafana resource-ready gate
The Grafana workstream is ready to start when the contributor can successfully
run all three of these checks:
The public-demo task is ready only after the hosted Grafana account, isolated
demo dataset, demo-only service account, query cap, and link-revocation owner
are all available.
Project B — Claude Code tracing plugin resources
A. Claude/Anthropic resources
claude.start Claude Code sessions.
claude --plugin-dir.plugin for smoke testing.
older BQAA plugin installations. Multiple active BQAA plugins duplicate
telemetry.
B. Python runtime used by the hooks
BQAA_PYTHON; Python 3.12 isrecommended.
google-cloud-bigqueryinstalled in that exact interpreter.google-cloud-bigquery-storageandpyarrowinstalled in the sameinterpreter.
below
/tmp/bqaa-agent-tracingand/tmp/bqaa-agent-tracing.log.unreachable.
The plugin vendors
bigquery-agent-analytics-tracing; that package does notneed to be separately installed into
BQAA_PYTHONfor plugin runtime.C. Google Cloud resources for the live plugin smoke
bigquery.googleapis.com.agent_eventstest table, or permission for the plugin to create it.BQAA_PYTHON.IAM for the plugin writer identity:
roles/bigquery.dataEditoron the destination dataset.roles/bigquery.useron the project.roles/bigquery.metadataVieweron the dataset whenBQAA_AUTO_CREATE_TABLE=true.The contributor does not need production dataset access. Prefer a pre-created
dataset because
BQAA_AUTO_CREATE_DATASETis disabled by default.D. Required runtime configuration
The maintainer must provide non-secret values for:
BQAA_PROJECT_ID— test GCP project ID.BQAA_DATASET— disposable test dataset.BQAA_PYTHON— exact Python interpreter used by hooks.BQAA_AGENT_NAME— unique smoke-test producer name, such asvendor-plugin-smoke.Useful test controls:
BQAA_DRY_RUN=truefor the first test without BigQuery writes.BQAA_TRACE_ENABLED=falsefor the kill-switch test.BQAA_TABLEif the table is notagent_events.BQAA_LOCATIONwhen the BigQuery location must be explicit.BQAA_AUTO_CREATE_TABLE=trueonly when the identity has the required schemainspection and table-creation permissions.
No API key belongs in these environment variables. Google authentication uses
ADC or an approved service-account mechanism.
E. Development and build tools
producers/pyproject.toml.pytest,isort, andpyinkfor CI-equivalent validation.producers/build-requirements.lock.build generates
vendor/and stamps the local plugin manifest.F. Marketplace smoke resources
GoogleCloudPlatform/BigQuery-Agent-Analytics-SDKas a marketplace.G. Additional resources only if the contributor is asked to operate the
0.2.0releaseThese are not needed for ordinary plugin code, local validation, or a PR. They
require designated Google maintainers or organization owners:
tracing-testpypi,tracing-pypi, andrelease-promoteenvironments.release-tracing.yml.access, installed only on this repository.
tracing-v0.2.0tag.Workload Identity Federation, budget alerts, and egress monitoring when
the OTel receiver image from Release bigquery-agent-analytics-tracing 0.2.0: publish the Claude/Codex OTel admin stack to PyPI #349 is in scope.
The exact privileged release checklist is maintained in
#353.
Do not give repository secrets or broad organization permissions to the
contributor merely to unblock local plugin work.
Claude Code resource-ready gate
The normal development and smoke-test workstream is ready when these succeed:
Inside a locally loaded plugin session,
/bqaa-setupmust reportREADYbefore the live BigQuery smoke begins. Release operation is not ready until
every unchecked maintainer prerequisite in #353 has an explicit owner and is
completed.
fix(plugins): honor BQAA_TRACE_ENABLED=TRUE in hooks and report dry-r…