mirror of
https://github.com/docker/compose.git
synced 2025-07-25 06:34:35 +02:00
otel attribute to track builder implementation selected
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
094b48fd74
commit
7b3bdbe037
@ -50,6 +50,8 @@ import (
|
|||||||
"github.com/moby/buildkit/util/progress/progressui"
|
"github.com/moby/buildkit/util/progress/progressui"
|
||||||
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
|
"go.opentelemetry.io/otel/attribute"
|
||||||
|
"go.opentelemetry.io/otel/trace"
|
||||||
|
|
||||||
// required to get default driver registered
|
// required to get default driver registered
|
||||||
_ "github.com/docker/buildx/driver/docker"
|
_ "github.com/docker/buildx/driver/docker"
|
||||||
@ -101,6 +103,7 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opti
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if bake {
|
if bake {
|
||||||
|
trace.SpanFromContext(ctx).SetAttributes(attribute.String("builder", "bake"))
|
||||||
return s.doBuildBake(ctx, project, serviceToBuild, options)
|
return s.doBuildBake(ctx, project, serviceToBuild, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,6 +200,7 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opti
|
|||||||
serviceName := fmt.Sprintf("Service %s", name)
|
serviceName := fmt.Sprintf("Service %s", name)
|
||||||
|
|
||||||
if !buildkitEnabled {
|
if !buildkitEnabled {
|
||||||
|
trace.SpanFromContext(ctx).SetAttributes(attribute.String("builder", "classic"))
|
||||||
cw.Event(progress.BuildingEvent(serviceName))
|
cw.Event(progress.BuildingEvent(serviceName))
|
||||||
id, err := s.doBuildClassic(ctx, project, service, options)
|
id, err := s.doBuildClassic(ctx, project, service, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -220,6 +224,7 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opti
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trace.SpanFromContext(ctx).SetAttributes(attribute.String("builder", "buildkit"))
|
||||||
digest, err := s.doBuildBuildkit(ctx, name, buildOptions, w, nodes)
|
digest, err := s.doBuildBuildkit(ctx, name, buildOptions, w, nodes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user