The Simplest Way to Make Google Pub/Sub and Kibana Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

You pair google pub/sub and kibana by streaming cloud events into a search store. An ingestion worker reads queue messages and indexes them so teams can chart trends. This setup helps teams spot app errors and track system health in real time. Google Pub/Sub holds burst traffic while the search cluster indexes each batch at a steady pace. Without a solid bridge between these tools, teams face dropped logs and blind spots. How data and roles flow between google pub/sub and kibana Kibana does

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 kibana by streaming cloud events into a search store. An ingestion worker reads queue messages and indexes them so teams can chart trends.

This setup helps teams spot app errors and track system health in real time. Google Pub/Sub holds burst traffic while the search cluster indexes each batch at a steady pace. Without a solid bridge between these tools, teams face dropped logs and blind spots.

How data and roles flow between google pub/sub and kibana

Kibana does not read messages straight from a Google Pub/Sub topic on its own. Instead, a middle worker pulls events from the subscription and writes them into Elasticsearch. Kibana then reads those stored records so your team can build charts and alerts.

Each step in this pipeline needs its own tight identity and role check. The cloud subscription needs a Google service account with permission to pull messages. The ingestion worker also needs a role that lets it write to specific search indices. Finally, engineers log in to Kibana with their own user roles to run queries.

When you set up this flow, separate the read rights from the write rights. The worker should only pull from one subscription and write to one index pattern. Human users should only read the indexed data through their search views. This split keeps a mistake in one tool from breaking the rest of the pipeline.

Common failure modes and how to scope network paths

Many teams rush the setup and use one broad service key for all workers. If that single key leaks, an attacker can read every message topic in your project. Teams also share one admin login in Kibana to save time during an incident. Shared logins hide who ran a heavy query or deleted an index.

Unlogged queries create another big risk when raw app events hold private user data. Payment queues often carry emails, phone numbers, card numbers, or national IDs in the payload. If everything lands in the search store raw, any dashboard viewer sees those fields. Masking rules can rewrite matched fields in results before an engineer views the screen.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You can fix the key risk by giving each worker a dedicated service account. Grant that account only the subscriber role on the single topic it needs to read. Rotate keys on a set schedule, or use workload identity to skip static keys.

Next, lock down the network path between the queue worker and your search cluster. Place the ingestion worker inside a private network and block public traffic to the database. Use private endpoints so log data never crosses the open internet during transit. Inside Kibana, map identity provider groups to index roles so teams only query their own apps.

Keeping schemas and queues clean in production

Bad message shapes can stall the whole pipeline if you do not plan ahead. When an app team changes a JSON field type, the search store rejects the write. The worker then fails to ack the message, and the queue backs up fast.

Set up a dead-letter topic in Google Pub/Sub to catch messages that fail to index. This simple rule keeps bad payloads out of the main flow while you fix the schema. You can inspect the dead-letter queue later and replay the fixed events without losing data.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Can Kibana pull messages straight from a Google Pub/Sub topic?

No, Kibana is a visual interface for data that already lives in Elasticsearch. You must run an ingestion worker or data pipeline to move messages into the search store first.

How do I stop bad log messages from blocking my subscription?

Attach a dead-letter topic to your subscription with a low retry limit. Messages that fail to index move to the side queue so fresh logs keep flowing.

What is the safest way to handle sensitive fields in log payloads?

Strip or mask emails, phone numbers, and card numbers before indexing, or apply field masking rules. This approach rewrites matched fields in results while keeping the rest of the log useful.

The query runs. The emails stay hidden.