...
1 package wfe2
2
3 import (
4 "github.com/prometheus/client_golang/prometheus"
5 )
6
7 type wfe2Stats struct {
8
9
10 httpErrorCount *prometheus.CounterVec
11
12
13 joseErrorCount *prometheus.CounterVec
14
15
16 csrSignatureAlgs *prometheus.CounterVec
17
18
19 improperECFieldLengths prometheus.Counter
20
21
22 nonceNoMatchingBackendCount prometheus.Counter
23 }
24
25 func initStats(stats prometheus.Registerer) wfe2Stats {
26 httpErrorCount := prometheus.NewCounterVec(
27 prometheus.CounterOpts{
28 Name: "http_errors",
29 Help: "client request errors at the HTTP level",
30 },
31 []string{"type"})
32 stats.MustRegister(httpErrorCount)
33
34 joseErrorCount := prometheus.NewCounterVec(
35 prometheus.CounterOpts{
36 Name: "jose_errors",
37 Help: "client request errors at the JOSE level",
38 },
39 []string{"type"})
40 stats.MustRegister(joseErrorCount)
41
42 csrSignatureAlgs := prometheus.NewCounterVec(
43 prometheus.CounterOpts{
44 Name: "csr_signature_algs",
45 Help: "Number of CSR signatures by algorithm",
46 },
47 []string{"type"},
48 )
49 stats.MustRegister(csrSignatureAlgs)
50
51 improperECFieldLengths := prometheus.NewCounter(
52 prometheus.CounterOpts{
53 Name: "improper_ec_field_lengths",
54 Help: "Number of account EC keys with improper X and Y lengths",
55 },
56 )
57 stats.MustRegister(improperECFieldLengths)
58
59 nonceNoBackendCount := prometheus.NewCounter(
60 prometheus.CounterOpts{
61 Name: "nonce_no_backend_found",
62 Help: "Number of times we've received a nonce with a prefix that doesn't match a known backend",
63 },
64 )
65 stats.MustRegister(nonceNoBackendCount)
66
67 return wfe2Stats{
68 httpErrorCount: httpErrorCount,
69 joseErrorCount: joseErrorCount,
70 csrSignatureAlgs: csrSignatureAlgs,
71 improperECFieldLengths: improperECFieldLengths,
72 nonceNoMatchingBackendCount: nonceNoBackendCount,
73 }
74 }
75
View as plain text