Skip to content

Commit b66c991

Browse files
committed
Merge branch 'copilot/sub-pr-2906' into jerm/vmcp-o11y
2 parents 30e09c2 + f57ee1f commit b66c991

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

docs/operator/virtualmcpserver-observability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ the workflow name as an attribute.
3939

4040
## Distributed Tracing
4141

42-
The vMCP creates spans for each individual backend operation as well as workflow executions, enabling the attribution of workflow exection errors or latency to specific tool calls.
42+
The vMCP creates spans for each individual backend operation as well as workflow executions, enabling the attribution of workflow execution errors or latency to specific tool calls.
4343

4444

4545
## Configuration

pkg/vmcp/server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ func (s *Server) Start(ctx context.Context) error {
385385
logger.Info("RFC 9728 OAuth discovery endpoints enabled at /.well-known/")
386386
}
387387

388-
// MCP endpoint - apply middleware chain: auth → discovery
388+
// MCP endpoint - apply middleware chain: auth → discovery → telemetry
389389
var mcpHandler http.Handler = streamableServer
390390

391391
if s.config.TelemetryProvider != nil {

pkg/vmcp/server/telemetry.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ func monitorBackends(
3939
backendCount.Record(ctx, int64(len(backends)))
4040

4141
requestsTotal, err := meter.Int64Counter(
42-
"toolhive_vmcp_backend_requests_total",
42+
"toolhive_vmcp_backend_requests",
4343
metric.WithDescription("Total number of requests per backend"),
4444
)
4545
if err != nil {
4646
return nil, fmt.Errorf("failed to create requests total counter: %w", err)
4747
}
4848
errorsTotal, err := meter.Int64Counter(
49-
"toolhive_vmcp_backend_errors_total",
49+
"toolhive_vmcp_backend_errors",
5050
metric.WithDescription("Total number of errors per backend"),
5151
)
5252
if err != nil {
@@ -55,6 +55,7 @@ func monitorBackends(
5555
requestsDuration, err := meter.Float64Histogram(
5656
"toolhive_vmcp_backend_requests_duration",
5757
metric.WithDescription("Duration of requests in seconds per backend"),
58+
metric.WithUnit("s"),
5859
)
5960
if err != nil {
6061
return nil, fmt.Errorf("failed to create requests duration histogram: %w", err)
@@ -161,24 +162,25 @@ func monitorWorkflowExecutors(
161162
meter := meterProvider.Meter(instrumentationName)
162163

163164
executionsTotal, err := meter.Int64Counter(
164-
"toolhive_vmcp_workflow_executions_total",
165+
"toolhive_vmcp_workflow_executions",
165166
metric.WithDescription("Total number of workflow executions"),
166167
)
167168
if err != nil {
168169
return nil, fmt.Errorf("failed to create workflow executions counter: %w", err)
169170
}
170171

171172
errorsTotal, err := meter.Int64Counter(
172-
"toolhive_vmcp_workflow_errors_total",
173+
"toolhive_vmcp_workflow_errors",
173174
metric.WithDescription("Total number of workflow execution errors"),
174175
)
175176
if err != nil {
176177
return nil, fmt.Errorf("failed to create workflow errors counter: %w", err)
177178
}
178179

179180
executionDuration, err := meter.Float64Histogram(
180-
"toolhive_vmcp_workflow_duration_seconds",
181+
"toolhive_vmcp_workflow_duration",
181182
metric.WithDescription("Duration of workflow executions in seconds"),
183+
metric.WithUnit("s"),
182184
)
183185
if err != nil {
184186
return nil, fmt.Errorf("failed to create workflow duration histogram: %w", err)

0 commit comments

Comments
 (0)