telemetry埋点

This commit is contained in:
2025-04-13 11:55:01 +08:00
parent 4f47689253
commit 91bb5e4e5a
2 changed files with 11 additions and 5 deletions

View File

@ -19,6 +19,7 @@ var tracer = otel.Tracer("vpt")
func startTask(device config.DeviceMapping, task dto.Task) {
ctx, span := tracer.Start(context.Background(), "startTask")
defer span.End()
span.SetAttributes(attribute.String("deviceNo", device.DeviceNo))
span.SetAttributes(attribute.String("taskId", task.TaskID))
span.SetAttributes(attribute.String("scenicId", task.ScenicID))