MCPcopy Create free account
hub / github.com/InferCore/InferCore / emitInferStepTrace

Method emitInferStepTrace

internal/server/server.go:702–725  ·  view source on GitHub ↗
(traceID, requestID, tenantID, stepType, backend, stepStatus string, start time.Time, latencyMs int64)

Source from the content-addressed store, hash-verified

700}
701
702func (s *Server) emitInferStepTrace(traceID, requestID, tenantID, stepType, backend, stepStatus string, start time.Time, latencyMs int64) {
703 if !s.cfg.Telemetry.TracingEnabled {
704 return
705 }
706 end := start.UnixMilli() + latencyMs
707 result := "success"
708 if stepStatus != "success" {
709 result = "failed"
710 }
711 s.telemetry.EmitTrace(types.TraceRecord{
712 TraceID: traceID,
713 SpanID: traceutil.NewSpanID(),
714 Name: "infer_step",
715 StartUnix: start.UnixMilli(),
716 EndUnix: end,
717 Labels: map[string]string{
718 "request_id": requestID,
719 "tenant_id": tenantID,
720 "step_type": stepType,
721 "backend": backend,
722 "result": result,
723 },
724 })
725}
726
727func (s *Server) emitTelemetryMetric(name string, value float64, labels map[string]string) {
728 if !s.cfg.Telemetry.MetricsEnabled {

Callers 1

inferMethod · 0.95

Calls 2

NewSpanIDFunction · 0.92
EmitTraceMethod · 0.65

Tested by

no test coverage detected