What runbook should an AI SRE follow for slow database queries?
Tares lets you write a slow database queries runbook as a document and attach it to the affected service with the reference connector. Because the document carries the service’s labels, it comes back whenever the agent correlates on that service. You write the runbook once, and it appears next to the live events for the same entity.
How it works
The reference connector holds documents (json, csv, md or txt) such as project notes, schemas and runbooks. It is declarative reference material, not a stream, so there is no poll interval and no entity key. Correlation is label-native.
- Each attachment has a name, the document text as content, an optional format and a set of labels that describe the entity it belongs to, for example a service and an environment.
- Each document is materialized into one always-surfaced event.
- A reference document is surfaced when you correlate on its entity, regardless of the read time window. A runbook does not age out of a 15-minute read.
- The labels you declare on the source become real Tares labels you can read and trigger on.
For a slow database queries runbook, tag the document with the labels of the database service. When the AI SRE workflow reads that service, the runbook is in the timeline with the recent events.
Set it up
- In Tares, go to Sources → Add source → Reference documents.
- Upload your runbook as a md or txt file. Tares reads it into text.
- Tag the file with the labels of the entity it describes, such as
serviceandenvironment. - Select Create. To add more documents later, re-open the source and select Upload more.
You can also declare the source in YAML, or send the same object with POST /api/sources. The labels list declares the label names so reads can correlate on them. Each attachment provides the values.
- name: runbooks
connector: reference
config:
attachments:
- name: slow-queries.md
format: md
content: |
Slow database queries
1. Identify which queries are slow.
2. Check what changed recently.
3. Record what you find.
labels: { service: checkout-db, environment: production }
labels:
- { name: service, field: service }
- { name: environment, field: environment }Replace the example steps with your own procedure, since the document holds whatever text you write. See the reference connector page for the full field list.
To verify, open the source. Recent events shows one event per document, and Fields shows the labels they carry. Read the entity by its service label and the document comes back in the timeline, even outside the read window.
What you get
- The slow database queries runbook is attached to the service by its labels, not to a time range.
- It is always surfaced when the agent correlates on that service and environment, next to the live events.
- The runbook does not age out of short reads.
- You can edit the source to update the document. Editing re-materializes it.
- You can add more documents for the same labels or for other entities with Upload more.
- The labels on each document are real Tares labels, so you can read and trigger on them like any other source’s labels.
When something else fits
- If you need a stream of events, such as query logs or table changes, use an event connector like the Postgres connector. A reference document is static text, not a feed.
- If the content changes often and should come from another system, an event connector that polls it fits better, because reference documents are edited by hand or uploaded again.