mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 23:04:20 +01:00
tracing: Add sandbox and container ID to trace spans
Add sandbox, container, and hypervisor IDs to trace spans. Note that some spans in sandbox.go are created with a trace() call from api.go. These spans have additional attributes set after span creation to overwrite the api attributes. Fixes #1878 Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
This commit is contained in:
@@ -360,7 +360,7 @@ func (c *Container) trace(parent context.Context, name string) (otelTrace.Span,
|
||||
}
|
||||
|
||||
tracer := otel.Tracer("kata")
|
||||
ctx, span := tracer.Start(parent, name, otelTrace.WithAttributes(otelLabel.String("source", "runtime"), otelLabel.String("package", "virtcontainers"), otelLabel.String("subsystem", "container")))
|
||||
ctx, span := tracer.Start(parent, name, otelTrace.WithAttributes(otelLabel.String("source", "runtime"), otelLabel.String("package", "virtcontainers"), otelLabel.String("subsystem", "container"), otelLabel.String("container_id", c.id)))
|
||||
|
||||
return span, ctx
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user