Conversation
…gging - copilot.tool.duration/calls, vfs.materialize, file.read metrics on Sim's MeterProvider (shared buckets, bounded labels, name-capped) at the tool/VFS/file-read boundaries - metrics-v1 TS mirror + sync-metrics-contract script + GENERATORS entry; regen trace-attributes/events mirrors (adds gen_ai.system) - deployment.environment from APPCONFIG_ENVIRONMENT (production -> prod) so a single Grafana $env spans Sim + Go without a new infra env var
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR adds server-side OTel metrics to Sim's copilot layer (tool execution, VFS materialization, and file reads) so Go and Sim emit identical metric names, label keys, and histogram bucket boundaries — enabling a unified
Confidence Score: 4/5The change is additive telemetry only — no data paths, auth flows, or user-facing behavior is modified. Two instrumentation call sites (workspace-vfs.ts and executor.ts) silently drop metrics when the inner operation throws, meaning error durations never appear in the histogram and p50/p99 will be skewed toward happy-path timings. Additionally, file-reader.ts records raw record.size (stored input bytes) rather than actual output bytes, which diverges for resized images and text-extracted documents. Neither issue affects runtime correctness or user-facing behavior, but the dashboards built on these metrics will have structural blind spots from day one. apps/sim/lib/copilot/vfs/workspace-vfs.ts and apps/sim/lib/copilot/request/tools/executor.ts — both emit metrics only after a successful await, so thrown errors produce no signal. apps/sim/lib/copilot/vfs/file-reader.ts — the size argument uses source file size rather than output bytes. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Tool Call - executor.ts] -->|startedAt = Date.now| B[executeToolAndReportInner]
B -->|success| C[durationMs = Date.now - startedAt]
B -->|throws| X1[metric SKIPPED]
C --> D[recordSimToolMetric name, outcome, durationMs]
D --> E[metrics.ts instruments]
E --> F[copilot.tool.calls counter]
E --> G[copilot.tool.duration histogram]
H[readFileRecord - file-reader.ts] -->|startedAt = Date.now| I[startActiveSpan callback]
I -->|null on internal error| J[recordFileRead read_failed record.size]
I -->|non-null result| K[recordFileRead success record.size]
K -->|input size not output| E
L[materializeVFS - workspace-vfs.ts] -->|start = Date.now| M[startActiveSpan callback]
M -->|success| N[totalMs = Date.now - start]
M -->|throws| X2[metrics SKIPPED]
N --> O[recordVfsMaterialize per-phase + total]
O --> E
E --> P[OTLP to Mimir]
P --> Q[Grafana Go+Sim union queries]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Tool Call - executor.ts] -->|startedAt = Date.now| B[executeToolAndReportInner]
B -->|success| C[durationMs = Date.now - startedAt]
B -->|throws| X1[metric SKIPPED]
C --> D[recordSimToolMetric name, outcome, durationMs]
D --> E[metrics.ts instruments]
E --> F[copilot.tool.calls counter]
E --> G[copilot.tool.duration histogram]
H[readFileRecord - file-reader.ts] -->|startedAt = Date.now| I[startActiveSpan callback]
I -->|null on internal error| J[recordFileRead read_failed record.size]
I -->|non-null result| K[recordFileRead success record.size]
K -->|input size not output| E
L[materializeVFS - workspace-vfs.ts] -->|start = Date.now| M[startActiveSpan callback]
M -->|success| N[totalMs = Date.now - start]
M -->|throws| X2[metrics SKIPPED]
N --> O[recordVfsMaterialize per-phase + total]
O --> E
E --> P[OTLP to Mimir]
P --> Q[Grafana Go+Sim union queries]
Reviews (1): Last reviewed commit: "fix(lint): fix lint" | Re-trigger Greptile |
Summary
Mship observability updates
Companion: https://github.com/simstudioai/copilot/pull/306
Type of Change
Testing
Manual
Checklist