How to Integrate Metabase and TimescaleDB Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair metabase and timescaledb to build live charts from time-series data. This setup lets analysts track metrics and events through simple visual dashboards. Because TimescaleDB runs on PostgreSQL, the two tools talk over standard database ports. You add the database host and user credentials inside the Metabase admin panel. Metabase then runs regular schema checks and sends SQL queries when users view charts. How data and logins flow between metabase and timescaledb When a user opens

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.

Teams pair metabase and timescaledb to build live charts from time-series data. This setup lets analysts track metrics and events through simple visual dashboards.

Because TimescaleDB runs on PostgreSQL, the two tools talk over standard database ports. You add the database host and user credentials inside the Metabase admin panel. Metabase then runs regular schema checks and sends SQL queries when users view charts.

How data and logins flow between metabase and timescaledb

When a user opens a dashboard, Metabase translates that view into SQL queries. It sends those queries to the database using one shared pool of connections. TimescaleDB reads the time-series chunks and returns the matching rows to the app.

Metabase stores the database username and password in its own internal app database. Every chart and ad-hoc query in that setup shares the same database role. If that role has write access, a user could change or delete data. For safe operation, you must create a read-only role inside your database first.

Time-series tables often hold customer emails, phone numbers, card numbers, or national IDs. Standard database roles grant table access all at once to the reporting tool. You can use views or masking rules that rewrite matched fields in results. This step keeps sensitive values out of general business charts and exported files.

Common failure modes and how to scope access

Many teams use the default superuser account when they first link these tools. This choice creates a big risk if someone steals the stored password. A shared admin account also makes it hard to audit who ran what. In the database logs, every single query looks like it came from Metabase.

Heavy time-series queries can also slow down your main production database during peak hours. An analyst might query months of raw sensor or event data by mistake. Without query timeouts or read replicas, one bad dashboard can block production writes.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Start by creating a dedicated database role that can only read specific schemas. Revoke all permissions to create, update, or drop tables on that account. Grant select permissions only on the aggregated views or tables that analysts need.

Point your reporting tool at a read replica instead of the primary node. Set a short statement timeout on the reporting role to kill runaway queries. Lock down network paths so only the reporting server IP can reach the database. Require encrypted TLS connections between the two hosts to protect data in transit.

Managing direct queries and schema syncs

By default, the reporting app scans database tables on a set schedule. On huge time-series databases with many chunks, deep scans can waste server memory. Turn off deep value scanning if your database holds billions of raw rows. Let admins trigger schema syncs only when the table structure actually changes.

Review your database query logs each week to spot slow or broad queries. Check which dashboards hit raw tables instead of rolled-up summary views. Moving dashboards to summary views keeps charts fast and protects database health.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Does Metabase need a special driver to query TimescaleDB?

No, you do not need a custom driver for this setup. Because TimescaleDB is a PostgreSQL extension, the standard PostgreSQL driver works out of the box.

How do we stop dashboards from slowing down production writes?

Point the reporting tool at a dedicated read replica instead of the main node. You should also set a hard query timeout on the database reporting role.

How can we keep sensitive user fields out of charts?

Restrict the database role to clean SQL views that exclude private columns. You can also apply masking rules that rewrite emails or phone numbers in results.

The query runs. The emails stay hidden.