@@ -20,6 +20,8 @@ import (
20
20
"strings"
21
21
"time"
22
22
23
+ "github.com/docker/compose/v2/pkg/utils"
24
+
23
25
"github.com/compose-spec/compose-go/types"
24
26
moby "github.com/docker/docker/api/types"
25
27
"go.opentelemetry.io/otel/attribute"
@@ -73,6 +75,7 @@ func ProjectOptions(proj *types.Project) SpanOptions {
73
75
attribute .StringSlice ("project.secrets" , proj .SecretNames ()),
74
76
attribute .StringSlice ("project.configs" , proj .ConfigNames ()),
75
77
attribute .StringSlice ("project.extensions" , keys (proj .Extensions )),
78
+ attribute .StringSlice ("project.includes" , flattenIncludeReferences (proj .IncludeReferences )),
76
79
}
77
80
return []trace.SpanStartEventOption {
78
81
trace .WithAttributes (attrs ... ),
@@ -150,3 +153,13 @@ func timeAttr(key string, value time.Time) attribute.KeyValue {
150
153
func unixTimeAttr (key string , value int64 ) attribute.KeyValue {
151
154
return timeAttr (key , time .Unix (value , 0 ).UTC ())
152
155
}
156
+
157
+ func flattenIncludeReferences (includeRefs map [string ][]types.IncludeConfig ) []string {
158
+ ret := utils .NewSet [string ]()
159
+ for _ , included := range includeRefs {
160
+ for i := range included {
161
+ ret .AddAll (included [i ].Path ... )
162
+ }
163
+ }
164
+ return ret .Elements ()
165
+ }
0 commit comments