The Simplest Way to Make Google Pub/Sub and Metabase Work Like They Should
You pair google pub/sub and metabase by landing streaming messages in an analytical database first. Metabase then reads that database to build live charts and team dashboards. Google Pub/Sub moves event messages between apps at high speed. Metabase runs SQL queries against tables to show business trends. Because Pub/Sub holds queues rather than SQL tables, you need a middle storage step. A cloud data warehouse or relational database bridges the two tools. How data and permissions flow between
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You pair google pub/sub and metabase by landing streaming messages in an analytical database first. Metabase then reads that database to build live charts and team dashboards.
Google Pub/Sub moves event messages between apps at high speed. Metabase runs SQL queries against tables to show business trends. Because Pub/Sub holds queues rather than SQL tables, you need a middle storage step. A cloud data warehouse or relational database bridges the two tools.
How data and permissions flow between google pub/sub and metabase
First, your apps send event messages to a Google Pub/Sub topic. Next, a subscriber job reads those messages from the topic. That job writes the event rows into a SQL database like BigQuery or PostgreSQL. Finally, Metabase logs in to that SQL database to run chart queries.
Each step in this pipeline needs its own identity and role. The ingestion worker uses a Google Cloud service account to pull Pub/Sub messages. That same worker uses a write role to insert rows into the database. Metabase uses a separate read-only database user to query the finished tables.
Separating these identities keeps your data pipeline safe. The ingestion worker cannot read old tables or change schemas. The Metabase user cannot push fake messages or delete raw event rows. Each tool only gets the exact permissions required for its job.
Common failure modes and how to scope roles
Many teams reuse one big service account across the whole pipeline. They give that single account full admin rights to Pub/Sub and the database. If an attacker steals that key, they can read or delete everything. Shared keys also make audit logs very hard to read.
When Metabase runs on a shared admin key, every chart query looks identical. Database logs show the service account name instead of the real person. You cannot tell which analyst ran a heavy query or viewed customer rows. Broad database roles also let chart builders query raw staging tables by mistake.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Streaming payloads often include sensitive data like emails, phone numbers, or card numbers. If raw JSON lands straight in reporting tables, every dashboard user sees those fields. You should strip or mask emails and phone numbers before Metabase queries the table. Data masking rewrites matched fields in results so analysts work with safe outputs.
Designing a clean ingestion and reporting path
Start by creating two separate schemas in your analytical database. Use one schema for raw Pub/Sub payloads and another for clean reporting views. Give your ingestion service account permission to write only to the raw schema. Give your Metabase database role permission to read only the clean reporting schema.
Next, lock down the network paths between each service. Keep your database on a private network with strict firewall rules. Allow inbound traffic only from your ingestion worker and your Metabase host. Rotate your service account keys on a regular schedule to limit risk.
Also, set query timeouts and cost limits on the database role Metabase uses. Streaming tables grow fast and can hold billions of event rows. A missing date filter in Metabase can trigger a huge table scan. Database resource limits stop one bad dashboard query from slowing down ingestion.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Can Metabase read messages straight from a Google Pub/Sub topic?
No, Metabase needs a structured database or data warehouse to run queries. You must land Pub/Sub messages in a SQL store like BigQuery or PostgreSQL first.
How do we keep sensitive event fields out of Metabase charts?
Filter or mask fields like emails, phone numbers, and national IDs during ingestion. You can also apply dynamic masking so queries return rewritten values in results.
What database permissions should the Metabase role have?
Give the Metabase database user read-only select permissions on clean reporting views. Never grant write, delete, or admin rights to the reporting tool.
Related guides
In this post