Change SD metric names to make logical grouping more visible. (#2102)

pull/2106/head
Dominik Schulz 8 years ago committed by Brian Brazil
parent 0c69227616
commit 552ab61fa1

@ -46,13 +46,13 @@ var (
azureSDScrapeFailuresCount = prometheus.NewCounter( azureSDScrapeFailuresCount = prometheus.NewCounter(
prometheus.CounterOpts{ prometheus.CounterOpts{
Namespace: namespace, Namespace: namespace,
Name: "azure_sd_scrape_failures_total", Name: "sd_azure_scrape_failures_total",
Help: "Number of Azure-SD scrape failures.", Help: "Number of Azure-SD scrape failures.",
}) })
azureSDScrapeDuration = prometheus.NewSummary( azureSDScrapeDuration = prometheus.NewSummary(
prometheus.SummaryOpts{ prometheus.SummaryOpts{
Namespace: namespace, Namespace: namespace,
Name: "azure_sd_scrape_duration_seconds", Name: "sd_azure_scrape_duration_seconds",
Help: "The duration of a Azure-SD scrape in seconds.", Help: "The duration of a Azure-SD scrape in seconds.",
}) })
) )

@ -42,13 +42,13 @@ var (
dnsSDLookupsCount = prometheus.NewCounter( dnsSDLookupsCount = prometheus.NewCounter(
prometheus.CounterOpts{ prometheus.CounterOpts{
Namespace: namespace, Namespace: namespace,
Name: "dns_sd_lookups_total", Name: "sd_dns_lookups_total",
Help: "The number of DNS-SD lookups.", Help: "The number of DNS-SD lookups.",
}) })
dnsSDLookupFailuresCount = prometheus.NewCounter( dnsSDLookupFailuresCount = prometheus.NewCounter(
prometheus.CounterOpts{ prometheus.CounterOpts{
Namespace: namespace, Namespace: namespace,
Name: "dns_sd_lookup_failures_total", Name: "sd_dns_lookup_failures_total",
Help: "The number of DNS-SD lookup failures.", Help: "The number of DNS-SD lookup failures.",
}) })
) )

@ -50,13 +50,13 @@ var (
ec2SDScrapeFailuresCount = prometheus.NewCounter( ec2SDScrapeFailuresCount = prometheus.NewCounter(
prometheus.CounterOpts{ prometheus.CounterOpts{
Namespace: namespace, Namespace: namespace,
Name: "ec2_sd_scrape_failures_total", Name: "sd_ec2_scrape_failures_total",
Help: "The number of EC2-SD scrape failures.", Help: "The number of EC2-SD scrape failures.",
}) })
ec2SDScrapeDuration = prometheus.NewSummary( ec2SDScrapeDuration = prometheus.NewSummary(
prometheus.SummaryOpts{ prometheus.SummaryOpts{
Namespace: namespace, Namespace: namespace,
Name: "ec2_sd_scrape_duration_seconds", Name: "sd_ec2_scrape_duration_seconds",
Help: "The duration of a EC2-SD scrape in seconds.", Help: "The duration of a EC2-SD scrape in seconds.",
}) })
) )

@ -50,28 +50,21 @@ const (
) )
var ( var (
gceSDScrapesCount = prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: namespace,
Name: "gce_sd_scrapes_total",
Help: "The number of GCE-SD scrapes.",
})
gceSDScrapeFailuresCount = prometheus.NewCounter( gceSDScrapeFailuresCount = prometheus.NewCounter(
prometheus.CounterOpts{ prometheus.CounterOpts{
Namespace: namespace, Namespace: namespace,
Name: "gce_sd_scrape_failures_total", Name: "sd_gce_scrape_failures_total",
Help: "The number of GCE-SD scrape failures.", Help: "The number of GCE-SD scrape failures.",
}) })
gceSDScrapeDuration = prometheus.NewSummary( gceSDScrapeDuration = prometheus.NewSummary(
prometheus.SummaryOpts{ prometheus.SummaryOpts{
Namespace: namespace, Namespace: namespace,
Name: "gce_sd_scrape_duration", Name: "sd_gce_scrape_duration",
Help: "The duration of a GCE-SD scrape in seconds.", Help: "The duration of a GCE-SD scrape in seconds.",
}) })
) )
func init() { func init() {
prometheus.MustRegister(gceSDScrapesCount)
prometheus.MustRegister(gceSDScrapeFailuresCount) prometheus.MustRegister(gceSDScrapeFailuresCount)
prometheus.MustRegister(gceSDScrapeDuration) prometheus.MustRegister(gceSDScrapeDuration)
} }
@ -147,7 +140,6 @@ func (gd *GCEDiscovery) refresh() (tg *config.TargetGroup, err error) {
t0 := time.Now() t0 := time.Now()
defer func() { defer func() {
gceSDScrapeDuration.Observe(time.Since(t0).Seconds()) gceSDScrapeDuration.Observe(time.Since(t0).Seconds())
gceSDScrapesCount.Inc()
if err != nil { if err != nil {
gceSDScrapeFailuresCount.Inc() gceSDScrapeFailuresCount.Inc()
} }

Loading…
Cancel
Save