Skip to content

Commit 4ce63f5

Browse files
authored
Merge pull request #11485 from jhrotko/add-otel-build-depends-capabilities
add OTEL build,depends and capabilities to attributes
2 parents 1fea7c1 + 2eca931 commit 4ce63f5

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/AlecAivazis/survey/v2 v2.3.7
77
github.com/Microsoft/go-winio v0.6.1
88
github.com/buger/goterm v1.0.4
9-
github.com/compose-spec/compose-go/v2 v2.0.0-rc.4
9+
github.com/compose-spec/compose-go/v2 v2.0.0-rc.5
1010
github.com/containerd/console v1.0.3
1111
github.com/containerd/containerd v1.7.12
1212
github.com/davecgh/go-spew v1.1.1

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+g
8686
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
8787
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE=
8888
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=
89-
github.com/compose-spec/compose-go/v2 v2.0.0-rc.4 h1:vVDWv1xm7Lqi7sEevU0Jk+T2huxNzf92lFhqKbn3sT8=
90-
github.com/compose-spec/compose-go/v2 v2.0.0-rc.4/go.mod h1:IbZsys5a7eFTsdcWvM3brnghkK7ctZwUSr7mCj5NXu0=
89+
github.com/compose-spec/compose-go/v2 v2.0.0-rc.5 h1:YoGsuVzxve1m5SdCfZqI8wJoMVZWu7SelHoqiCqb+iQ=
90+
github.com/compose-spec/compose-go/v2 v2.0.0-rc.5/go.mod h1:bEPizBkIojlQ20pi2vNluBa58tevvj0Y18oUSHPyfdc=
9191
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
9292
github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw=
9393
github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw=

internal/tracing/attributes.go

+6
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ func ProjectOptions(proj *types.Project) SpanOptions {
6161
return nil
6262
}
6363

64+
capabilities, gpu, tpu := proj.ServicesWithCapabilities()
6465
attrs := []attribute.KeyValue{
6566
attribute.String("project.name", proj.Name),
6667
attribute.String("project.dir", proj.WorkingDir),
@@ -74,6 +75,11 @@ func ProjectOptions(proj *types.Project) SpanOptions {
7475
attribute.StringSlice("project.configs", proj.ConfigNames()),
7576
attribute.StringSlice("project.extensions", keys(proj.Extensions)),
7677
attribute.StringSlice("project.includes", flattenIncludeReferences(proj.IncludeReferences)),
78+
attribute.StringSlice("project.services.build", proj.ServicesWithBuild()),
79+
attribute.StringSlice("project.services.depends_on", proj.ServicesWithDependsOn()),
80+
attribute.StringSlice("project.services.capabilities", capabilities),
81+
attribute.StringSlice("project.services.capabilities.gpu", gpu),
82+
attribute.StringSlice("project.services.capabilities.tpu", tpu),
7783
}
7884
if projHash, ok := projectHash(proj); ok {
7985
attrs = append(attrs, attribute.String("project.hash", projHash))

0 commit comments

Comments
 (0)