@@ -68,45 +68,45 @@ var (
68
68
lastSCTTimestamp * prometheus.GaugeVec // origin => value
69
69
reqsCounter * prometheus.CounterVec // origin, op => value
70
70
rspsCounter * prometheus.CounterVec // origin, op, code => value
71
- rspLatency * prometheus.HistogramVec // origin, op, code => value
71
+ rspDuration * prometheus.HistogramVec // origin, op, code => value
72
72
)
73
73
74
74
// setupMetrics initializes all the exported metrics.
75
75
func setupMetrics () {
76
76
// TODO(phboneff): add metrics for deduplication and chain storage.
77
77
knownLogs = promauto .NewGaugeVec (
78
78
prometheus.GaugeOpts {
79
- Name : "ct_known_logs " ,
79
+ Name : "ct_known_logs_info " ,
80
80
Help : "Set to 1 for known logs" ,
81
81
},
82
82
[]string {"origin" })
83
83
lastSCTTimestamp = promauto .NewGaugeVec (
84
84
prometheus.GaugeOpts {
85
- Name : "ct_last_sct_timestamp_ms " ,
86
- Help : "Time of last SCT in ms since epoch" ,
85
+ Name : "ct_sct_last_timestamp_seconds " ,
86
+ Help : "Time of last SCT in seconds since epoch" ,
87
87
},
88
88
[]string {"origin" })
89
89
lastSCTIndex = promauto .NewGaugeVec (
90
90
prometheus.GaugeOpts {
91
- Name : "ct_last_sct_index " ,
91
+ Name : "ct_sct_last_index " ,
92
92
Help : "Index of last SCT" ,
93
93
},
94
94
[]string {"origin" })
95
95
reqsCounter = promauto .NewCounterVec (
96
96
prometheus.CounterOpts {
97
- Name : "ct_http_reqs " ,
97
+ Name : "ct_http_requests_total " ,
98
98
Help : "Number of requests" ,
99
99
},
100
100
[]string {"origin" , "ep" })
101
101
rspsCounter = promauto .NewCounterVec (
102
102
prometheus.CounterOpts {
103
- Name : "ct_http_rsps " ,
103
+ Name : "ct_http_responses_total " ,
104
104
Help : "Number of responses" ,
105
105
},
106
106
[]string {"origin" , "op" , "code" })
107
- rspLatency = promauto .NewHistogramVec (
107
+ rspDuration = promauto .NewHistogramVec (
108
108
prometheus.HistogramOpts {
109
- Name : "ct_http_latency " ,
109
+ Name : "ct_http_request_duration_seconds " ,
110
110
Help : "Latency of responses in seconds" ,
111
111
},
112
112
[]string {"origin" , "op" , "code" })
@@ -140,7 +140,7 @@ func (a appHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
140
140
a .opts .RequestLog .origin (logCtx , a .log .origin )
141
141
defer func () {
142
142
latency := a .opts .TimeSource .Now ().Sub (startTime ).Seconds ()
143
- rspLatency .WithLabelValues (label0 , label1 , strconv .Itoa (statusCode )).Observe (latency )
143
+ rspDuration .WithLabelValues (label0 , label1 , strconv .Itoa (statusCode )).Observe (latency )
144
144
}()
145
145
klog .V (2 ).Infof ("%s: request %v %q => %s" , a .log .origin , r .Method , r .URL , a .name )
146
146
// TODO(phboneff): add a.Method directly on the handler path and remove this test.
@@ -352,7 +352,7 @@ func addChainInternal(ctx context.Context, opts *HandlerOptions, log *log, w htt
352
352
}
353
353
klog .V (3 ).Infof ("%s: %s <= SCT" , log .origin , method )
354
354
if sct .Timestamp == timeMillis {
355
- lastSCTTimestamp .WithLabelValues (log .origin ).Set (float64 (sct .Timestamp ))
355
+ lastSCTTimestamp .WithLabelValues (log .origin ).Set (float64 (sct .Timestamp ) / 1000 )
356
356
lastSCTIndex .WithLabelValues (log .origin ).Set (float64 (idx ))
357
357
}
358
358
0 commit comments