Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cns/restserver/internalapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (service *HTTPRestService) SyncHostNCVersion(ctx context.Context, channelMo
if err != nil {
logger.Errorf("sync host error %v", err)
}
syncHostNcVersion.WithLabelValues(strconv.FormatBool(err == nil)).Observe(time.Since(start).Seconds())
syncHostNCVersion.WithLabelValues(strconv.FormatBool(err == nil)).Observe(time.Since(start).Seconds())
}

var errNonExistentContainerStatus = errors.New("nonExistantContainerstatus")
Expand Down
2 changes: 1 addition & 1 deletion cns/restserver/ipam.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (service *HTTPRestService) requestIPConfigHandler(w http.ResponseWriter, r
defer func() {
// observe IP assignment wait time
if since := service.podsPendingIPAssignment.Pop(podInfo.Key()); since > 0 {
ipAssignmentLatency.Observe(float64(since))
ipAssignmentLatency.Observe(since.Seconds())
}
}()
reserveResp := &cns.IPConfigResponse{
Expand Down
8 changes: 4 additions & 4 deletions cns/restserver/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ var ipAssignmentLatency = prometheus.NewHistogram(

var ipConfigStatusStateTransitionTime = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Name: "ipconfigstatus_state_transition",
Name: "ipconfigstatus_state_transition_seconds",
Help: "Time spent by the IP Configuration Status in each state transition",
//nolint:gomnd // default bucket consts
Buckets: prometheus.ExponentialBuckets(0.001, 2, 15), // 1 ms to ~16 seconds
},
[]string{"previous_state", "next_state"},
)

var syncHostNcVersion = prometheus.NewHistogramVec(
var syncHostNCVersion = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Name: "sync_host_nc_version",
Name: "sync_host_nc_version_seconds",
Help: "Sync Host NC Latency",
//nolint:gomnd // default bucket consts
Buckets: prometheus.ExponentialBuckets(0.001, 2, 15), // 1 ms to ~16 seconds
Expand All @@ -54,7 +54,7 @@ func init() {
httpRequestLatency,
ipAssignmentLatency,
ipConfigStatusStateTransitionTime,
syncHostNcVersion,
syncHostNCVersion,
)
}

Expand Down