diff options
author | Sebastian Jug <sejug@redhat.com> | 2018-10-16 16:30:53 -0400 |
---|---|---|
committer | Sebastian Jug <seb@stianj.ug> | 2019-02-18 09:57:08 -0500 |
commit | 7141f972700ed454438d8539dd0bec79c0b61cf4 (patch) | |
tree | bfa2e524b71757a514a02ef68661b46dca9a3dfe /libpod/container_api.go | |
parent | e738ef16225395f5f5e4b93ba1a43ae9449ae11b (diff) | |
download | podman-7141f972700ed454438d8539dd0bec79c0b61cf4.tar.gz podman-7141f972700ed454438d8539dd0bec79c0b61cf4.tar.bz2 podman-7141f972700ed454438d8539dd0bec79c0b61cf4.zip |
OpenTracing support added to start, stop, run, create, pull, and ps
Drop context.Context field from cli.Context
Signed-off-by: Sebastian Jug <sejug@redhat.com>
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r-- | libpod/container_api.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go index abe0df610..09d7f220d 100644 --- a/libpod/container_api.go +++ b/libpod/container_api.go @@ -14,6 +14,7 @@ import ( "github.com/containers/libpod/pkg/lookup" "github.com/containers/storage/pkg/stringid" "github.com/docker/docker/daemon/caps" + opentracing "github.com/opentracing/opentracing-go" "github.com/pkg/errors" "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/util/wait" @@ -22,6 +23,10 @@ import ( // Init creates a container in the OCI runtime func (c *Container) Init(ctx context.Context) (err error) { + span, _ := opentracing.StartSpanFromContext(ctx, "containerInit") + span.SetTag("struct", "container") + defer span.Finish() + if !c.batched { c.lock.Lock() defer c.lock.Unlock() @@ -66,6 +71,10 @@ func (c *Container) Init(ctx context.Context) (err error) { // Init(). // If recursive is set, Start will also start all containers this container depends on. func (c *Container) Start(ctx context.Context, recursive bool) (err error) { + span, _ := opentracing.StartSpanFromContext(ctx, "containerStart") + span.SetTag("struct", "container") + defer span.Finish() + if !c.batched { c.lock.Lock() defer c.lock.Unlock() |