SRE & Observability
TeaQL gives operators several places to correlate business intent with runtime work, but the visibility of a comment in an application log, database log, APM system, or audit sink must be verified separately.
Current evidence boundary: the maintained Rust Golden Path executes TeaQL
4.1.1 with SQLite. Current generated-workspace environment variables and the
separate teaql-runtime formatter layer have been source-reviewed. PostgreSQL
and MySQL server-log propagation, production APM integrations, trace-chain
formatting, and load behavior have not been executed by this documentation.
Observable Intent Boundaries
| Boundary | Application contract | What it can provide | What still needs verification |
|---|---|---|---|
| Query | comment(...) → purpose(...) → execute_for_xxx(...) | Operation description and business reason attached before execution. | Exact emitted fields, redaction, provider propagation, and sink retention. |
| Mutation | audit_as(...) → save(...) or update(...) | Business audit description for the persisted graph. | Event completeness, transaction timing, sink failure behavior, masking, and durability. |
| Runtime SQL/audit/tool output | Generated-workspace environment configuration. | Selectable detail, filtering, and sink choice. | Subscriber wiring, output destination permissions, reload behavior, and performance cost. |
| Rust tracing | Application-installed tracing subscriber. | Runtime spans/events visible to the configured subscriber. | Field schema and export behavior for the selected subscriber/APM stack. |
| Database observability | Provider/driver/database logging pipeline. | Potential correlation with executed statements. | Whether comments survive preparation, normalization, proxies, server logging, and aggregation. |
Intent metadata is operational evidence, not authorization. Tenant and permission constraints still belong in application policy and must be tested on every data-access path.
Current Generated-Workspace Controls
Newly generated Rust applications use the teaql-tool-core configuration path:
TEAQL_AUDITcontrols entity/audit detail;TEAQL_SQLcontrols SQL detail;TEAQL_SQL_TABLESrestricts SQL output to named generated tables;TEAQL_TOOLandTEAQL_TOOL_FOCUScontrol context-tool output;TEAQL_SINKselects_stdout,_file, or_both;TEAQL_SCHEMAselects the parsed schema mode.
For example, a temporary diagnostic run can request full SQL details for one generated table:
TEAQL_SQL=_full TEAQL_SQL_TABLES=task TEAQL_SINK=_stdout cargo run
Use the exact generated table name. The current parser rejects an unknown table, focused tool module, or misspelled variable in its protected prefixes.
The older TEAQL_AUDIT_LOG, TEAQL_SQL_LOG, TEAQL_TOOL_LOG, and
TEAQL_LOG_ENDPOINT names belong to a separate formatter compatibility layer;
they are not aliases for the generated-workspace settings. Do not mix the two
tables. See Environment Variables for
accepted values, defaults, precedence, and validation behavior.
Application Tracing
Install a tracing subscriber in the application before expecting Rust spans
or events to be visible:
tracing_subscriber::fmt::init();
The subscriber and TeaQL audit configuration are related observability surfaces, not the same mechanism. Verify which fields the generated/runtime version emits and which fields the subscriber exports.
For async stalls, use the application's Tokio instrumentation and the Concurrency and Deadlocks guide. Do not infer a database lock from a suspended Rust task without checking both runtime and database evidence.
Database Visibility Is Provider-Specific
Do not assume a query comment reaches a database log merely because it appears in source or application output. For every provider and environment, test:
- the exact TeaQL provider, database, and driver versions;
- prepared and unprepared query paths;
- connection pools, proxies, gateways, and statement normalization;
- slow-query/general logs and database performance views;
- comment retention and truncation;
- parameter and sensitive-value handling;
- aggregation/cardinality effects in the monitoring system;
- the overhead of the selected detail level under representative load.
PostgreSQL, MySQL, and SQLite have different logging surfaces. The current documentation has not retained a PostgreSQL/MySQL run proving TeaQL intent comments in server logs, and SQLite has no standalone database server log. Treat database-specific commands as deployment runbooks only after the selected combination passes this matrix.
Incident Workflow
When a slow query, unexpected mutation, or missing audit record appears:
- Capture the application request/trace identifier and time window.
- Record TeaQL runtime/provider/database and generated-workspace versions.
- Confirm the handwritten request uses
comment→purpose→ execution, or the mutation usesaudit_asbefore persistence. - Inspect application tracing, TeaQL SQL/audit output, provider logs, and the configured sink as separate evidence sources.
- Compare the generated request and repository/provider path without editing generated code.
- Reproduce with the smallest safe logging scope and a disposable dataset.
- Restore normal logging after capture and retain a redacted incident record.
If application output contains the intent but the database view does not, test the driver/proxy/server pipeline. If neither contains it, inspect request construction and subscriber/sink initialization first.
Data-Safety Rules
- Do not enable full payload output until masking, authorization, retention, access, and deletion have been reviewed.
- Treat SQL, parameters, tool URLs, request bodies, user identity, and local paths as potentially sensitive.
- Use table and module filters to limit incident collection.
- Do not publish raw logs as documentation evidence without redaction.
- Do not treat
TEAQL_SCHEMA=_dryrunas non-mutating: the currently generated runtime callsensure_schema()for every parsed schema mode. - Do not claim an audit record is durable until sink delivery, transaction timing, retries, failure behavior, and storage controls have been tested.
Verification Checklist
- Exact runtime, provider, database, and subscriber versions are recorded.
- Query
commentandpurposeappear at the intended application boundary. - Mutation
audit_asappears before persistence. - Current generated-workspace variables, not formatter aliases, configure the run.
- Application logs and database/APM visibility are checked independently.
- Sensitive fields and payloads are redacted in every enabled sink.
- Logging overhead and failure behavior are tested.
- Evidence is retained with timestamps, commands, and expected/actual output.
For verified configuration details, use Environment Variables. For output shapes and module examples, use Audit Log Reference. For missing spans or events, use Observability and Tracing.