New feature: prometheus metrics endpoint (#46)

This commit is contained in:
2025-11-03 18:36:13 +01:00
committed by GitHub
parent ec1de1fa81
commit e8d3a20781
13 changed files with 564 additions and 82 deletions

View File

@@ -3,6 +3,8 @@ package service
import (
"net"
"time"
"github.com/dcarrillo/whatismyip/internal/metrics"
)
const scannerTimeOut = 3 * time.Second
@@ -20,5 +22,6 @@ func (p *PortScanner) IsPortOpen() (bool, error) {
defer conn.Close()
}
metrics.RecordPortScan()
return true, nil
}