Monitoring
DAIV supports LangSmith for tracing agent executions. This page covers how to set it up and what data is available.
Setup
1. Get an API key
- Sign in at smith.langchain.com
- Go to Settings → API Keys → Create API Key
- Copy the key (format:
lsv2_pt_...)
2. Configure environment variables
Docker Compose
| YAML | |
|---|---|
Docker Swarm
| Bash | |
|---|---|
| Bash | |
|---|---|
EU endpoint
If you're in Europe, set LANGSMITH_ENDPOINT=https://eu.api.smith.langchain.com.
3. Restart services
| Bash | |
|---|---|
4. Verify
- Create a test issue with the
daivlabel - Open your LangSmith project — traces should appear within a few minutes
See Environment Variables for all LangSmith-related variables.
Trace tags and metadata
Every agent run includes tags and metadata that make it easy to filter and build dashboards in LangSmith.
Tags
All runs include two tags:
| Tag | Description | Example |
|---|---|---|
| Agent name | Always DAIV Agent |
DAIV Agent |
| Git platform | The platform handling the request | gitlab, github |
Metadata by trigger
Issue addressing (triggered by labelled issues):
| JSON | |
|---|---|
Comment addressing (triggered by @daiv mentions on merge requests):
The scope field distinguishes how the agent was triggered: Issue, Merge Request, or Global.
Dashboard tips
- By trigger type — filter by
scopeor by metadata keyissue_idvsmerge_request_id - By user — filter or group by
author - Performance — monitor execution time and token usage per run
Bash command policy logs
DAIV emits structured warning logs whenever the sandbox bash tool blocks a command due to policy evaluation or a parse failure. These logs use the daiv.tools logger.
Log events
bash_policy_denied — a command segment matched a disallow rule:
| Text Only | |
|---|---|
bash_policy_parse_failed — the command string could not be parsed (fail-closed):
| Text Only | |
|---|---|
Log fields
| Field | Description |
|---|---|
event |
bash_policy_denied or bash_policy_parse_failed |
reason_category |
default_disallow, repo_disallow, or parse_failure |
matched_rule |
The rule prefix that triggered denial (e.g. "git push") |
denied_segment |
The specific argv segment that was blocked |
tool_call_id |
The agent tool-call ID for correlation with LangSmith traces |
Monitoring recommendations
- Alert on high denial rates — a spike in
bash_policy_deniedmay indicate the agent is repeatedly attempting prohibited operations. - Tune policy rules — use
reason_categoryto distinguish built-in denials from custom repo-level denials and adjust.daiv.ymlaccordingly. - Correlate with LangSmith — the
tool_call_idlinks each denial to the full agent trace for deeper investigation.
Troubleshooting
No traces appearing:
- Verify
LANGSMITH_TRACING=trueis set - Check the API key is correct
- Ensure network connectivity to LangSmith endpoints
- Review application logs for authentication errors
Incomplete trace data:
- Verify the project name matches across all services
- Ensure Docker secrets are properly mounted (Swarm deployments)