Skip to content

Commit

Permalink
track more tls versions (#7)
Browse files Browse the repository at this point in the history
older tls is close to being eradicated, but it's nice to track older
versions while we're still accepting older clients
  • Loading branch information
davidbirdsong authored and peterbourgon committed Oct 24, 2018
1 parent c90649d commit a24e11f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fastly.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ type datacenter struct {
MissTime float64 `json:"miss_time"`
PassTime float64 `json:"pass_time"`
MissHistogram map[string]uint64 `json:"miss_histogram"`
TLSv10 uint64 `json:"tls_v10"`
TLSv11 uint64 `json:"tls_v11"`
TLSv12 uint64 `json:"tls_v12"`
TLSv13 uint64 `json:"tls_v13"`
ObjectSize1k uint64 `json:"object_size_1k"`
ObjectSize10k uint64 `json:"object_size_10k"`
ObjectSize100k uint64 `json:"object_size_100k"`
Expand Down
3 changes: 3 additions & 0 deletions process.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ func process(src realtimeResponse, serviceID string, serviceName string, dst *pr
dst.missTimeTotal.WithLabelValues(serviceID, serviceName, datacenter).Add(float64(stats.MissTime))
dst.passTimeTotal.WithLabelValues(serviceID, serviceName, datacenter).Add(float64(stats.PassTime))
processHistogram(stats.MissHistogram, dst.missDurationSeconds.WithLabelValues(serviceID, serviceName, datacenter))
dst.tlsv10Total.WithLabelValues(serviceID, serviceName, datacenter).Add(float64(stats.TLSv10))
dst.tlsv11Total.WithLabelValues(serviceID, serviceName, datacenter).Add(float64(stats.TLSv11))
dst.tlsv12Total.WithLabelValues(serviceID, serviceName, datacenter).Add(float64(stats.TLSv12))
dst.tlsv13Total.WithLabelValues(serviceID, serviceName, datacenter).Add(float64(stats.TLSv13))
processObjectSizes(
stats.ObjectSize1k, stats.ObjectSize10k, stats.ObjectSize100k,
stats.ObjectSize1m, stats.ObjectSize10m, stats.ObjectSize100m,
Expand Down
15 changes: 15 additions & 0 deletions prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ type prometheusMetrics struct {
missTimeTotal *prometheus.CounterVec
passTimeTotal *prometheus.CounterVec
missDurationSeconds *prometheus.HistogramVec
tlsv10Total *prometheus.CounterVec
tlsv11Total *prometheus.CounterVec
tlsv12Total *prometheus.CounterVec
tlsv13Total *prometheus.CounterVec
objectSizeBytes *prometheus.HistogramVec
recvSubTimeTotal *prometheus.CounterVec
recvSubCountTotal *prometheus.CounterVec
Expand Down Expand Up @@ -348,10 +351,22 @@ func (m *prometheusMetrics) register(namespace, subsystem string) {
Help: "Total time spent serving misses.",
Buckets: []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2, 4, 8, 16, 32, 60},
}, []string{"service_id", "service_name", "datacenter"})
m.tlsv10Total = promauto.NewCounterVec(prometheus.CounterOpts{Namespace: namespace, Subsystem: subsystem,
Name: "tls_v10_total",
Help: "Total number of TLS v1.0 requests.",
}, []string{"service_id", "service_name", "datacenter"})
m.tlsv11Total = promauto.NewCounterVec(prometheus.CounterOpts{Namespace: namespace, Subsystem: subsystem,
Name: "tls_v11_total",
Help: "Total number of TLS v1.1 requests.",
}, []string{"service_id", "service_name", "datacenter"})
m.tlsv12Total = promauto.NewCounterVec(prometheus.CounterOpts{Namespace: namespace, Subsystem: subsystem,
Name: "tls_v12_total",
Help: "Total number of TLS v1.2 requests.",
}, []string{"service_id", "service_name", "datacenter"})
m.tlsv13Total = promauto.NewCounterVec(prometheus.CounterOpts{Namespace: namespace, Subsystem: subsystem,
Name: "tls_v13_total",
Help: "Total number of TLS v1.3 requests.",
}, []string{"service_id", "service_name", "datacenter"})
m.objectSizeBytes = promauto.NewHistogramVec(prometheus.HistogramOpts{Namespace: namespace, Subsystem: subsystem,
Name: "object_size_bytes",
Help: "Size of objects served in bytes.",
Expand Down

0 comments on commit a24e11f

Please sign in to comment.