The Simplest Way to Make Ceph and Cortex Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Running Ceph and Cortex together pairs scalable object storage with a multi-tenant metric engine. Cortex receives time-series metrics and writes long-term data blocks into Ceph object buckets. This setup lets platform teams keep years of monitoring data on their own hardware. Teams query old metrics through Cortex while Ceph handles disk failures and data copies. How data and keys flow between Ceph and Cortex Ceph offers an object storage interface that matches standard cloud bucket APIs. Co

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.

Running Ceph and Cortex together pairs scalable object storage with a multi-tenant metric engine. Cortex receives time-series metrics and writes long-term data blocks into Ceph object buckets.

This setup lets platform teams keep years of monitoring data on their own hardware. Teams query old metrics through Cortex while Ceph handles disk failures and data copies.

How data and keys flow between Ceph and Cortex

Ceph offers an object storage interface that matches standard cloud bucket APIs. Cortex uses this interface to store compressed blocks of metric data and index files.

First, monitoring agents send live metric streams to the Cortex ingester components. The ingesters hold recent data in memory and then flush blocks to Ceph.

To write these blocks, Cortex needs a valid object storage user and secret key. An admin creates a dedicated user inside the Ceph object storage service for Cortex.

That user owns the specific bucket where Cortex writes metric blocks and tenant indexes. Cortex store-gateway and compactor services also use keys to read and merge old blocks.

When an engineer runs a dashboard query, the Cortex querier checks the bucket index. It pulls only the needed data chunks from Ceph and returns the graph results.

All traffic between the two systems moves over internal network paths using encrypted transport. Keeping both tools on the same local network avoids slow reads during heavy queries.

Common failure modes and how to scope roles

Many teams start by sharing one root storage key across every Cortex service. A single leaked key then gives an attacker full control over all stored buckets.

Broad keys also let a broken script delete production metric blocks by mistake. Instead, teams should create separate Ceph users for writing data and reading data.

End-to-End Encryption + Cortex Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

The Cortex ingester and compactor need write access to the metric bucket. Query services only need read access to fetch blocks for user dashboards.

Another common issue happens when engineers debug storage problems with shared admin keys. When five people use the same key, audit logs cannot show who deleted a bucket.

Unlogged queries against raw metric buckets can also expose sensitive system labels. Sometimes metric labels hold user emails or phone numbers by mistake.

Data masking rewrites matched fields in results so those emails do not leak. Scoping network paths is just as important as scoping storage keys.

Only Cortex pods and approved admin hosts should reach the Ceph object endpoints. Blocking public network routes stops outside attackers from probing your storage cluster.

Keeping storage operations fast and safe at scale

As metric volume grows, the Cortex compactor works harder to merge small blocks. If Ceph disks are slow, compaction falls behind and queries time out.

Placing Ceph bucket indexes on fast solid-state drives keeps block lookups quick. Standard hard drives can still hold the large compressed metric blocks to save money.

Teams should also set bucket lifecycle rules to delete very old test metrics. Cleaning up unused tenant data keeps bucket indexes small and speeds up every read.

Regular key rotation protects the link between your metric engine and storage cluster. Updating keys on a set schedule limits the damage if a config file leaks.

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

How does Cortex store metric data inside Ceph?

Ceph provides an S3-compatible object layer that Cortex uses as its long-term storage backend. Cortex groups incoming metrics into time blocks and uploads them directly into a Ceph bucket.

Should Cortex services share one Ceph user key?

No, sharing one key across all services creates a high security risk. Give write permissions only to ingesters and compactors, and give read-only keys to queriers.

Why are long-term metric queries running slow on Ceph?

Slow queries usually happen when the Ceph bucket index sits on slow spinning disks. Moving the bucket index pool to solid-state drives speeds up block lookups for Cortex.

The query runs. The emails stay hidden.