Skip to content

Commit

Permalink
outofband/bmc: include bmc-ip span attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrebel committed Jul 12, 2023
1 parent 8d988b3 commit 17f9044
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/outofband/bmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ func (b *bmc) Close(traceCtx context.Context) error {
_, span := otel.Tracer(pkgName).Start(traceCtx, "bmclib.Close")
defer span.End()

span.SetAttributes(attribute.String("bmc-ip", b.client.Auth.Host))

if b.client == nil {
return nil
}
Expand All @@ -115,6 +117,8 @@ func (b *bmc) PowerStatus(ctx context.Context) (string, error) {
ctx, span := otel.Tracer(pkgName).Start(ctx, "bmclib.PowerStatus")
defer span.End()

span.SetAttributes(attribute.String("bmc-ip", b.client.Auth.Host))

if err := b.Open(ctx); err != nil {
return "", err
}
Expand All @@ -132,6 +136,8 @@ func (b *bmc) SetPowerState(ctx context.Context, state string) error {
ctx, span := otel.Tracer(pkgName).Start(ctx, "bmclib.SetPowerState")
defer span.End()

span.SetAttributes(attribute.String("bmc-ip", b.client.Auth.Host))

if err := b.Open(ctx); err != nil {
return err
}
Expand Down Expand Up @@ -162,6 +168,8 @@ func (b *bmc) Inventory(ctx context.Context) (*common.Device, error) {
ctx, span := otel.Tracer(pkgName).Start(ctx, "bmclib.Inventory")
defer span.End()

span.SetAttributes(attribute.String("bmc-ip", b.client.Auth.Host))

if err := b.Open(ctx); err != nil {
return nil, err
}
Expand Down Expand Up @@ -203,6 +211,8 @@ func (b *bmc) FirmwareInstallStatus(ctx context.Context, installVersion, compone
ctx, span := otel.Tracer(pkgName).Start(ctx, "bmclib.FirmwareInstallStatus")
defer span.End()

span.SetAttributes(attribute.String("bmc-ip", b.client.Auth.Host))

if err := b.Open(ctx); err != nil {
return model.StatusInstallUnknown, errors.Wrap(ErrBMCQuery, err.Error())
}
Expand Down

0 comments on commit 17f9044

Please sign in to comment.