mirror of
https://github.com/imjasonh/snoop
synced 2026-07-19 07:04:01 +00:00
fix staticcheck
Signed-off-by: Jason Hall <jason@chainguard.dev>
This commit is contained in:
parent
6cc13a35c4
commit
1fe85ea6e8
2 changed files with 4 additions and 3 deletions
|
|
@ -73,7 +73,7 @@ func (c *Config) Validate() error {
|
|||
|
||||
// Validate report path is writable (check directory exists and is writable)
|
||||
if c.ReportPath != "" {
|
||||
dir := c.ReportPath
|
||||
var dir string
|
||||
// Get directory path
|
||||
if lastSlash := strings.LastIndex(c.ReportPath, "/"); lastSlash >= 0 {
|
||||
dir = c.ReportPath[:lastSlash]
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import (
|
|||
"net/http"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/collectors"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
)
|
||||
|
||||
|
|
@ -82,8 +83,8 @@ func New() *Metrics {
|
|||
)
|
||||
|
||||
// Register default process metrics (CPU, memory, etc.)
|
||||
registry.MustRegister(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}))
|
||||
registry.MustRegister(prometheus.NewGoCollector())
|
||||
registry.MustRegister(collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}))
|
||||
registry.MustRegister(collectors.NewGoCollector())
|
||||
|
||||
return m
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue