package main
import (
"context"
"fmt"
"log/slog"
"time"
"github.com/google/uuid"
"github.com/tilebox/tilebox-go/workflows/v1"
)
func main() {
ctx := context.Background()
client := workflows.NewClient()
jobID := uuid.MustParse("019e07b1-916b-0630-f3ba-f1c33235d174")
for span, err := range client.Jobs.QuerySpans(ctx, jobID) {
if err != nil {
slog.ErrorContext(ctx, "failed to query job spans", slog.Any("error", err))
return
}
fmt.Printf("%s %-40s %s\n",
span.StartTime.Format(time.RFC3339Nano),
span.Name,
span.Duration(),
)
}
}