localmetrics

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRT_SH_PG_DB_HOSTNAME string = "crt.sh"
	CRT_SH_PG_DB_PORT     int    = 5432
	CRT_SH_PG_DB_USERNAME string = "guest"
	CRT_SH_PG_DB_NAME     string = "certwatch"

	GET_COUNT_CERTS_ISSUED_BY_LE_SQL string = `` /* 988-byte string literal not displayed */

	GET_LIST_CERTS_ISSUED_BY_LE_SQL string = `` /* 997-byte string literal not displayed */

	GET_LIST_CERTS_ISSUED_BY_LE_SQL_EXPIRING_SOON string = `` /* 1013-byte string literal not displayed */

)

Variables

View Source
var (
	MetricCertsIssuedInLastDayOpenshiftCom = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name: "certman_operator_certs_in_last_day_openshift_com",
		Help: "Report how many certs have been issued for Openshift.com in the last 24 hours",
	}, []string{"name"})
	MetricCertsIssuedInLastDayOpenshiftAppsCom = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name: "certman_operator_certs_in_last_day_openshift_apps_com",
		Help: "Report how many certs have been issued for Openshiftapps.com in the last 24 hours",
	}, []string{"name"})
	MetricCertsIssuedInLastWeekOpenshiftCom = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name: "certman_operator_certs_in_last_week_openshift_com",
		Help: "Report how many certs have been issued for Openshift.com in the last 7 days",
	}, []string{"name"})
	MetricCertsIssuedInLastWeekOpenshiftAppsCom = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name: "certman_operator_certs_in_last_week_openshift_apps_com",
		Help: "Report how many certs have been issued for Openshiftapps.com in the last 7 days",
	}, []string{"name"})
	MetricDuplicateCertsIssuedInLastWeek = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name: "certman_operator_duplicate_certs_in_last_week",
		Help: "Report how many certs have had duplicate issues",
	}, []string{"name"})
	MetricIssueCertificateDuration = prometheus.NewSummary(prometheus.SummaryOpts{
		Name:        "certman_operator_certificate_issue_duration",
		Help:        "Runtime of issue certificate function in seconds",
		ConstLabels: prometheus.Labels{"name": "certman-operator"},
	})

	MetricsList = []prometheus.Collector{
		MetricCertsIssuedInLastDayOpenshiftCom,
		MetricCertsIssuedInLastDayOpenshiftAppsCom,
		MetricCertsIssuedInLastWeekOpenshiftCom,
		MetricCertsIssuedInLastWeekOpenshiftAppsCom,
		MetricDuplicateCertsIssuedInLastWeek,
		MetricIssueCertificateDuration,
	}
)

Functions

func GetCountOfCertsIssued

func GetCountOfCertsIssued(domain string, durationDays int) int

GetCountOfCertsIssued returns the number of certs issued for a given domain in the last durationDays number of days

func GetListOfCertsExpiringSoon

func GetListOfCertsExpiringSoon(domain string, durationDays int) [][]string

GetListOfCertsExpiringSoon returns a list of certs expiring within the specified number of days

func GetListOfCertsIssued

func GetListOfCertsIssued(domain string, durationDays int) [][]string

GetListOfCertsIssued returns a list of certs issued for a given domain since durationDays number of days ago

func UpdateCertificateIssueDurationMetric

func UpdateCertificateIssueDurationMetric(time time.Duration)

func UpdateCertsIssuedInLastDayGauge

func UpdateCertsIssuedInLastDayGauge()

UpdateCertsIssuedInLastDayGauge sets the gauge metric with the number of certs issued in last day

func UpdateCertsIssuedInLastWeekGauge

func UpdateCertsIssuedInLastWeekGauge()

UpdateCertsIssuedInLastWeekGuage sets the gauge metric with the number of certs issued in last week

func UpdateDuplicateCertsIssuedInLastWeek

func UpdateDuplicateCertsIssuedInLastWeek()

UpdateDuplicateCertsIssuedInLastWeek ...

func UpdateMetrics

func UpdateMetrics(hour int)

UpdateMetrics updates all the metrics every N hours

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL