Skip to content

Commit 5763d2d

Browse files
committed
healthcheck labels as otel spans attributes
1 parent 8354241 commit 5763d2d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

healthcheck/root.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ func (c *Component) startWrapper(w *Wrapper) {
7676
span.SetStatus(codes.Error, "healthcheck failure")
7777
}
7878
span.SetAttributes(attribute.String("cabourotte.healthcheck.status", status))
79+
for k, v := range w.healthcheck.Base().Labels {
80+
span.SetAttributes(attribute.String(fmt.Sprintf("cabourotte.healthcheck.label.%s", k), v))
81+
}
7982
span.End()
8083
histoLabels := map[string]string{
8184
"name": w.healthcheck.Base().Name,

0 commit comments

Comments
 (0)