File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ const (
38
38
)
39
39
40
40
type Target struct {
41
-
42
41
// todo make keep it a map until Append happens
43
42
labels labels.Labels
44
43
serviceName string
@@ -95,6 +94,12 @@ func inferServiceName(target DiscoveryTarget) string {
95
94
if dockerContainer != "" {
96
95
return dockerContainer
97
96
}
97
+ if swarmService := target ["__meta_dockerswarm_container_label_service_name" ]; swarmService != "" {
98
+ return swarmService
99
+ }
100
+ if swarmService := target ["__meta_dockerswarm_service_name" ]; swarmService != "" {
101
+ return swarmService
102
+ }
98
103
return "unspecified"
99
104
}
100
105
@@ -271,5 +276,8 @@ func containerIDFromTarget(target DiscoveryTarget) containerID {
271
276
if ok && cid != "" {
272
277
return containerID (cid )
273
278
}
279
+ if cid , ok = target ["__meta_dockerswarm_task_container_id" ]; ok && cid != "" {
280
+ return containerID (cid )
281
+ }
274
282
return ""
275
283
}
You can’t perform that action at this time.
0 commit comments