DB Optimizer
DB Optimizer extends obolIQ's cost visibility from Kubernetes compute into the managed data stores your workloads depend on — Amazon RDS (MySQL, PostgreSQL) and Amazon ElastiCache (Redis, Valkey).
What it does
Two independent evidence streams feed the panel:
- Infrastructure metrics read from Amazon CloudWatch, and the instance inventory from the RDS and ElastiCache APIs. These calls must run with credentials in your AWS account, so who makes them depends on where obolIQ runs (see Where AWS is called from).
- Query telemetry (optional) captured by the eBPF agent, correlating database queries with the workloads that issued them.
Where AWS is called from
| Deployment | Discovery and CloudWatch | Status |
|---|---|---|
| Self-hosted / Private Cloud — oboliq-core runs in your AWS account | oboliq-core, with its IRSA role and the policy in Setup | Available |
| obolIQ Cloud — oboliq-core runs in obolIQ's account | The obolIQ agent in your cluster, with an IAM role you grant it | Not available yet |
obolIQ Cloud never calls AWS on your behalf. Its server runs in obolIQ's own AWS account, where an RDS or CloudWatch call would describe the wrong account's databases, so the console says so instead of attempting discovery. Collection from your account by the agent is the planned path; until it ships, query capture (below) works on obolIQ Cloud today, because the eBPF agent needs no AWS access.
Together they produce recommendations that neither stream can give alone: a specific query fingerprint issued by a named workload, matched to the CPU, connection and cache pressure it causes on a named database instance.
Architecture
┌─────────────────┐ CloudWatch ┌───────────────────┐
│ Amazon RDS │◄────GetMetricData───│ obolIQ server │
│ Amazon │ │ (IAM role) │
│ ElastiCache │ └───────────────────┘
└─────────────────┘ ▲
│
┌─────────────────┐ query fingerprints │
│ eBPF agent │───(relayed by oboliq-agent)┘
│ (optional) │
└─────────────────┘The diagram is the self-hosted layout, where the obolIQ server runs in your account.
Key points:
- Self-hosted: CloudWatch is scraped by the obolIQ server, with its own IAM role. No agent-side configuration needed.
- obolIQ Cloud: core makes no AWS call for discovery or metrics (
DB_OPTIMIZER_AWS_SOURCE=agent). - The eBPF agent adds optional query capture for the correlation layer.
- Only registered instances are polled — you control CloudWatch API cost directly.
- Metrics are kept for 15 days, the same as raw node and pod metrics.
Monitoring depth
Each registered instance has a monitoring depth setting:
| Depth | What it provides | Requires |
|---|---|---|
| CloudWatch Only | CPU, memory, connections, IOPS, storage, replication | IAM permissions on core |
| CloudWatch + Query Capture | All above + query fingerprints, execution counts, per-query latency | IAM, plus every precondition below — and one extra setting for TLS-encrypted databases |
Query capture preconditions
A default install of the oboliq-ebpf-agent chart (0.2.0 or later) meets the agent-side ones: query capture is on in fingerprint mode for every namespace except Kubernetes' own, and so is the TLS path described below. All of these must hold. Miss one and capture produces nothing — in most cases silently.
dbCapture.mode: fingerprint(orfull) on the eBPF agent, which is the default.offloads no query program at all, and turns the TLS path off with it.- The calling pod's namespace in scope.
dbCapture.namespacesdefaults to*, every namespace except those indbCapture.excludeNamespaces(kube-system,kube-public,kube-node-lease). A list of names narrows it; an empty value captures nothing. - A oboliq-agent with relay query forwarding, in the default relay mode. Query batches ride each flow window to the oboliq-agent, which forwards them to the ingest endpoint with its own key, so the eBPF DaemonSet still holds no key. Against an older oboliq-agent the eBPF agent logs that it is discarding query statistics and counts them.
mode: directalso works and sends them straight to the ingest endpoint. POSTGRES_DSNconfigured on core. Without it the query ingest RPC is not registered, so there is nothing to upload to.
Encrypted databases need one more setting
The preconditions above enable capture from the wire, which works only on unencrypted connections. If your database enforces TLS — rds.force_ssl=1, or ElastiCache with in-transit encryption — the wire carries ciphertext and those settings produce no statements no matter how correct they are.
Those need the uprobe path, which the chart turns on by default:
dbUprobe.mode: capture(DB_UPROBE_MODE=capture), withCAP_SYS_PTRACEandhostPID. The chart adds the capability whenever this mode is notoff. It reads the statement inside the client process, before it is encrypted. Without the capability the scan sees roughly 7% of the node and none of your application containers, which looks like "no databases here" rather than a misconfiguration. SetdbUprobe.mode: offto drop both the path and the capability; wire capture keeps working for plaintext databases.
Check it attached with kubectl -n oboliq logs -l app.kubernetes.io/name=oboliq-ebpf-agent --tail=-1 | grep -c "uprobe attached". The total across all pods should be above 0; a 0 on one pod is normal for a node running no Go database client.
What it covers today: Go clients on amd64 nodes. Other runtimes need an OpenSSL-level probe that is not built yet, and on arm64 (Graviton) the path is compiled out. Java is not addressable this way at all.
What it adds beyond statements: per-query latency on encrypted connections.
| Engine | How latency is measured | Coverage |
|---|---|---|
PostgreSQL (pgx, database/sql) | the client library call enclosing the query is timed end to end, so connection-pool wait is included | all executions |
| Redis / ElastiCache (go-redis) | the encrypted write is paired with the read that answers it | most executions |
Redis coverage is partial by design. A client can pipeline several commands into one write, and the round trip that returns cannot be attributed to any single one of them — so no per-command latency is recorded for those, rather than a divided or duplicated guess. The console shows the percentage of executions a latency average covers whenever it is not all of them.
Next steps
- Setup & IAM permissions — what to add to your IRSA role
- RDS metrics reference — which CloudWatch metrics are collected
- ElastiCache metrics reference — cache-specific metrics