alert_on_error_pattern— Sariva scans your app’s logs for patterns you specify, from the one log source your install has: AWS CloudWatch Logs or New Relic (ask your operator which; see Which log source your install has).alert_on_pod_restart— Sariva checks your app’s EKS pods for restarts.
Where do lag and metrics come from, then? Consumer lag and throughput come from your Kafka metrics source (the Confluent Cloud Metrics API) — not from logs. The log source is used only for log evidence (error patterns); pod health comes from the Kubernetes API — the things Kafka itself can’t tell you.
Error-pattern alerts
What it does. On an interval your platform team approves (every 5 minutes by default — 1, 5 or 15), Sariva runs one query against your app’s logs counting matches for every pattern over a window of the same length, so each line is read once. On a match it alerts, and includes the matching log lines as evidence. In chat, “what’s in payments-consumer’s logs?” reads the same way, on demand. Enable it — at registration, provide:-
log_locator— where your app’s logs are, as field/value pairs for your install’s source:- CloudWatch:
{"log_group": "/aws/eks/prod/payments-consumer"}(the legacy spellingcloudwatch_log_groupis still accepted for one release and means the same thing). - New Relic: the attributes that select your app’s lines in
FROM Log, e.g.{"container_name": "payments-consumer", "namespace_name": "payments"}— Sariva builds theWHEREclause; you never write NRQL.
- CloudWatch:
-
alert_on_error_pattern— the pattern(s) to watch, e.g.ERROR,connection pool exhausted. On CloudWatch each is a Logs Insightslike /…/(substring or regex); on New Relic each is an RE2 regular expression. Optional: with none set, Sariva searches the common error words —ERROR,Exception,FATAL,Traceback, any case — and every reply says so (“common error words; set error patterns to sharpen”). A JSON line that has alevelfield is read by its level instead:error,fatalorcritical(any case) is an error, anything else is not, so a clean line such as{"event": "stats", "errors": 0, "level": "info"}never counts. The words apply to lines with nolevelfield, such as plain-text librdkafka output. A numeric level (pino’s50) is not read as an error; set your own patterns for such an app. Producer failures (authentication, topic authorization, record too large, brokers unreachable) are searched on every line. Your own patterns are used exactly as written, on every line. Change them in chat: “also watch payments-consumer for Timeout and OOM”, “stop watching for FATAL” or “watch it only for Timeout”. Sariva shows the whole new list once and saves it on your yes, the same as aPUT. No new approval is needed, because a read is still one query. The app’s channel and the approvals channel are told who changed it. Words you add in chat match any case (the confirm says so); patterns set over the API stay exactly as written. If you drop a word from the common set, the rest keep matching in any case. -
monitor_errors: true— ask for scheduled monitoring. Patterns alone never turn it on: without this setting your patterns sharpen on-demand chat scans only.
monitor_errors: true and a log location records a request for scheduled monitoring (monitor_state: "requested" in the response) — nothing is read until your platform team approves it, below. You can also ask in chat — “alert me when payments-consumer logs errors”, “watch its logs for errors” — which posts the same request.
How far back Sariva looks
An on-demand read in chat covers the period you name, read the way you said it:- “what errors did payments-consumer throw in the last 2 hours?” — the last 120 minutes, ending now.
- “since 9am” — from 09:00 today until now.
- “between 2 and 3pm yesterday”, “yesterday afternoon” — a window that ends in the past is read as asked (CloudWatch
startTime/endTime, New RelicSINCE … UNTIL …). - Follow-ups continue the thread: “go back further” reads twice the last period, “and before that?” the same length ending where the last read began, “what about the last day?” the last 24 hours.
- Say nothing about time and Sariva reads the last 30 minutes.
Approval — your platform team switches scanning on
Log scanning costs money on your log provider’s bill at scale, so Sariva reads no app’s logs until a platform SRE says so — and there are two separate things to approve per app. One never grants the other, each is its own post in the SRE channel, and every cap is set by the SRE at approval; there is no install-wide default. The SRE channel is the install’s approvals channel (TEAMS_APPROVALS_CHANNEL_ID in Teams, notifications.slack.approval_channel or SLACK_APPROVAL_CHANNEL in Slack), or its alerts channel when no approvals channel is set; budget warnings and cap pauses go there too. Anyone who can reply in that channel may approve or deny for now.
On-demand log scans — the reads Sariva makes when someone asks about your app’s logs in chat.
- The first time anyone asks (“why is payments-consumer throwing errors?”), Sariva answers what it can read (lag, consumer-group state), says log scanning isn’t enabled for this app, I’ve asked your platform team, and posts one request: payments-consumer asks for on-demand log scans. Suggest: look-back up to 24 h, 50 scans/day. Reply approve / approve, lookback 72h, limit 100 / deny. A repeat ask never re-posts.
- An SRE replies in that post’s thread: approve (the suggested caps), approve, lookback 72h, limit 100 (their own), or deny. They can ask “why?” or “what will this cost?” first — the request keeps waiting; a value that belongs to the other feature (“every 15 minutes”) is answered, never applied.
- Sariva tells the thread that asked and offers to read the logs right then (“yes” runs the read). On deny it says so, and a later ask hears declined, never “no errors”.
- Asking for it —
monitor_errors: true(register, orPUTlater) with a log location, or a chat ask — posts one request: payments-consumer asks for scheduled error monitoring: 3 patterns every 5 min, est. 0.5 GB/day, suggest cap 20 GB/month. Reply approve / approve, every 15 min, cap 50 GB / deny. The estimate is honest — this period’s usage where there is some, otherwise an assumed 20 MB of log lines an hour — and the suggested cap is four times it, rounded up (GB per month on CloudWatch, queries per day on New Relic). - An SRE replies approve, approve, every 15 min, cap 50 (1, 5 or 15 minutes; any cap), or deny. Off-script replies work the same way as above.
- On approve the engine reads your app’s logs at that interval, all patterns in one query, under that cap. The approval is told to the thread that asked and to your app’s own channel, where its error alerts land.
PUT monitor_errors: false — the waiting request is withdrawn (no confirm) and the SRE’s post says so; an approve after that is refused.
The states on GET /api/v1/apps/{alias} (with monitor_errors, and who approved each feature — chat_scan_approved_by / monitor_approved_by hold the approver’s display name, the *_approved_by_id fields their chat user id): chat_scan_state is requested, approved or denied, with chat_scan_max_lookback_h and chat_scan_daily_limit; monitor_state is requested, approved, denied or paused, with monitor_interval_min, monitor_cap and monitor_cap_unit. An unapproved, denied or paused feature reads as not configured for that feature — never as “clean”.
What’s on, and turning it off
The list. In chat, “which apps have log scanning on?” or “what’s being monitored?” gets a list Sariva writes from the live registry — each app, each feature that is on, today’s scans against the limit, and who approved it and when. With nothing on it says No app has log scanning or monitoring on. Over REST:GET /api/v1/log-scanning returns the same rows (source, apps, and the plain-text text).
Turning it off. “Stop monitoring payments-consumer” (or “turn off chat scans for payments-consumer”) gets one “are you sure?” — “why?” is answered and it keeps waiting; “yes” turns it off, “no” keeps it. Off means it stops until someone asks again and an SRE approves again (turning monitoring off also sets monitor_errors: false). Your app’s channel and the thread that first asked for it are told. Asking to turn off something that isn’t on says so. Over REST, POST /api/v1/log-scanning/{alias}/turn-off with {"feature": "monitor"} or {"feature": "chat"} turns it off with no confirm (409 when it isn’t on, 404 for an unknown app). Anyone authenticated may turn it off for now.
Budget — what the caps allow per period
Per app. Scheduled monitoring runs under the cap the SRE set: at 80% Sariva warns your app’s chat thread; at 100% it pauses that app’s monitoring only (monitor_state: "paused"), tells your thread and the SRE channel, and resumes on its own when the next period starts (a month on CloudWatch, a day on New Relic). On-demand scans have the look-back and daily limit above.
Whole install (optional). Your platform team may also set LOG_SCAN_BUDGET in the setup wizard — GB scanned per month on CloudWatch (read from each query’s own statistics), queries per day on New Relic. Blank is the default: usage is tracked and nothing is ever paused by it. Set, it warns the SRE channel at 80% and pauses every app’s monitoring at 100% until next period; approvals and caps are kept. Usage per app, both states and both caps are on GET /api/v1/health (log_scanning) and in sariva validate logs — on a VM, run it on the host from the install folder: it reads usage and the field checks from the running platform over REST at http://localhost:8000 with SARIVA_PLATFORM_API_KEY from ./.env (no docker exec; --api-url https://<your-host> checks another host). If the platform is restarting it waits a few seconds, then says Sariva is still starting.
Which log source your install has
One per install, chosen in the setup wizard: CloudWatch Logs, New Relic, or none. With none, Sariva says plainly that it cannot read application logs — its capability card, greetings and declines all say so — and nothing on the registration enables it.sariva validate logs shows the source and makes one test read.
- CloudWatch Logs
- New Relic
Prerequisites:Application container logs then land in
- Your app’s logs must actually be in the log group you register — see the next section.
- The Sariva platform needs permission to run Logs Insights queries on that log group — on EKS via pod AWS identity; on a VM via the instance role (VM path).
Getting logs into CloudWatch (prerequisite)
Sariva reads logs; shipping them into CloudWatch is your platform’s job, with whatever shipper you already run — a Fluent Bit or OpenTelemetry DaemonSet, the CloudWatch agent, or a logging-library appender that writes to CloudWatch Logs directly. What Sariva needs from the result is simple:- One log group it can be pointed at — the name you register in
log_locatoraslog_group. - Know that the pattern scan covers the whole group. Sariva’s Logs Insights query filters on message content only (
filter @message like /<pattern>/), so everything in the group counts toward your app’s patterns. A dedicated log group per app keeps pattern alerts app-scoped; a shared group works, but every app in it is in scope of every pattern — and every byte of it counts against the install’s budget. - Plain-text lines match fine; structured/JSON logs keep patterns precise — the Python client config Sariva generates uses a structlog JSON renderer for exactly this.
Worked example: the CloudWatch Observability EKS add-on
If your cluster ships nothing today, the lowest-friction start on EKS is AWS’s own add-on, which runs Fluent Bit and collects container logs from all pods by default (AWS docs):/aws/containerinsights/<your-cluster>/application — register that name as your log_group. Because that group is shared by every pod in the cluster, treat it as a starting point: when pattern noise from other apps (or the scanned volume) becomes a problem, move to per-app log groups via your own shipper configuration (the add-on supports a custom Fluent Bit configuration) and update the app’s log_locator with PUT /api/v1/apps/{alias}.If your app runs on a Docker host instead of Kubernetes
Error-pattern scanning works the same way when the Sariva platform runs on the EC2 VM path — the registration still just needslog_locator + alert_on_error_pattern. Ship your container’s stdout however you already do; the Docker awslogs log driver is one ready-made way (a per-container logging: block that writes straight to a CloudWatch group using the host’s instance role), not the required one — any agent that lands your lines in a log group works. Pod health is different: with no Kubernetes there are no pods, and the health endpoint reports that dimension NotApplicable (see below) — log scanning and lag alerts are unaffected.Pod-restart alerts (EKS)
What it does. Each tick, Sariva reads the status of your app’s pods (scoped to the namespace you register) and alerts when a pod’s restart count increases. Enable it — provide at registration:eks_cluster_name,k8s_namespace,k8s_pod_label_selectoralert_on_pod_restart: true
What pod health means when there is no Kubernetes
The pod dimension exists only for an app that actually runs on EKS —infra_type: "aws_eks" at registration. An app registered with infra_type: "ec2" or "other" (the default on a VM-shape platform, since 0.5.127) has no pods to read, and GET /api/v1/apps/{alias}/health reports the dimension as NotApplicable — not an error, and it does not sink the overall status to unknown. The verdict then composes from the dimensions that do exist: an active alert (lag, error patterns, rebalances) marks the app degraded or unhealthy; a monitored app with nothing active reads healthy.
An aws_eks app whose pods can’t be read (missing fields, denied access) is different — that dimension exists and stays unknown, which honestly caps the verdict. An app registered before 0.5.127 against a VM-shape platform kept the old aws_eks default; move it with PUT /api/v1/apps/{alias} {"infra_type": "other"}.
Pod resource headroom (metrics-server)
Sariva can also report a pod’s CPU/memory headroom (live usage vs limits) on demand — e.g. “does payments-consumer have headroom?”. This reads themetrics.k8s.io API, served by metrics-server, which is not installed on EKS by default.
Prerequisite: install metrics-server on the cluster your app runs in — cleanest is the EKS managed add-on (EKS Console → cluster → Add-ons → metrics-server, or aws eks create-addon --cluster-name <cluster> --addon-name metrics-server --region <region>, or - name: metrics-server in an eksctl config). Pair it with the optional metrics.k8s.io read rule on the reader/RBAC role — see Cross-account reader setup.
At registration, set eks_cluster_name, k8s_namespace, and k8s_pod_label_selector so Sariva can locate the pods — the same three fields power both on-demand pod-health (“is my pod healthy?”) and headroom questions. For an app in a different AWS account, also set the cross-account fields described below.
Without metrics-server, pod status / restarts / events still work; only headroom degrades to “live usage unavailable.”
When your app runs in a different AWS account
If your app’s CloudWatch logs or pods live in a different AWS account than the Sariva platform, you create a read-only reader role in that account and tell Sariva its ARN. Sariva thensts:AssumeRoles into it before reading your CloudWatch logs and pod health; for a same-account app it uses its home identity unchanged. (A New Relic log source has no AWS account to cross — the account id and key the install carries select the logs.)
You provide one field at registration:
cross_account_reader_role_arn— the ARN of the reader role you author in the app’s account. Pair it withaws_regionandeks_cluster_nameso Sariva targets the right cluster.
aws_account_id.
The reader role + its read-only Kubernetes RBAC (trust policy, eks:DescribeCluster, scoped logs:StartQuery, and the namespace-scoped pod Role) are customer-authored — Sariva ships no infrastructure-as-code for them. The full copy-paste examples and per-topology guidance live on one page:
Cross-account reader setup
Trust policy + read-only IAM permissions + namespace-scoped Kubernetes RBAC, with Shape A/B/C guidance and a failure-mode table. Author once per target account.
Permissions summary
The AWS rows require pod AWS identity on the Sariva platform pod; every log read additionally requires the app’s scanning to be approved.