mirror of
https://github.com/dcarrillo/whatismyip.git
synced 2025-11-04 20:59:09 +00:00
New feature: prometheus metrics endpoint (#46)
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
"github.com/dcarrillo/whatismyip/internal/metrics"
|
||||
"github.com/dcarrillo/whatismyip/models"
|
||||
)
|
||||
|
||||
@@ -41,6 +42,7 @@ func (g *Geo) LookUpCity(ip net.IP) *models.GeoRecord {
|
||||
return nil
|
||||
}
|
||||
|
||||
metrics.RecordGeoLookup("city")
|
||||
return record
|
||||
}
|
||||
|
||||
@@ -51,6 +53,7 @@ func (g *Geo) LookUpASN(ip net.IP) *models.ASNRecord {
|
||||
return nil
|
||||
}
|
||||
|
||||
metrics.RecordGeoLookup("asn")
|
||||
return record
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user