fleet/server/service/metrics_labels.go
Zach Wasserman fb32f0cf40
Remove kolide types and packages from backend (#974)
Generally renamed `kolide` -> `fleet`
2021-06-06 15:07:29 -07:00

25 lines
557 B
Go

package service
import (
"context"
"fmt"
"time"
"github.com/fleetdm/fleet/server/fleet"
)
func (mw metricsMiddleware) ModifyLabel(ctx context.Context, id uint, p fleet.ModifyLabelPayload) (*fleet.Label, error) {
var (
lic *fleet.Label
err error
)
defer func(begin time.Time) {
lvs := []string{"method", "ModifyLabel", "error", fmt.Sprint(err != nil)}
mw.requestCount.With(lvs...).Add(1)
mw.requestLatency.With(lvs...).Observe(time.Since(begin).Seconds())
}(time.Now())
lic, err = mw.Service.ModifyLabel(ctx, id, p)
return lic, err
}