Skip to content

Commit

Permalink
healthcheck labels as otel spans attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcorbin committed Jan 11, 2025
1 parent 8354241 commit 5763d2d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions healthcheck/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ func (c *Component) startWrapper(w *Wrapper) {
span.SetStatus(codes.Error, "healthcheck failure")
}
span.SetAttributes(attribute.String("cabourotte.healthcheck.status", status))
for k, v := range w.healthcheck.Base().Labels {
span.SetAttributes(attribute.String(fmt.Sprintf("cabourotte.healthcheck.label.%s", k), v))
}
span.End()
histoLabels := map[string]string{
"name": w.healthcheck.Base().Name,
Expand Down

0 comments on commit 5763d2d

Please sign in to comment.