Skip to content

Commit

Permalink
Fix logging collector attribute (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock authored Jan 8, 2025
1 parent 0ac7a70 commit 3ad06d9
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion collectors/apache.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ func getApacheMetrics(apacheStatus string, fqdn string, ctx context.Context, log
}

func NewApacheCollector(logger *slog.Logger) *ApacheCollector {
logger.LogAttrs(context.Background(), slog.LevelInfo, "apache collector", slog.String("collector", "apache"))
return &ApacheCollector{
logger: logger,
WebsocketConnections: prometheus.NewDesc(prometheus.BuildFQName(namespace, "", "websocket_connections"), "Number of websocket connections", nil, nil),
Expand Down
2 changes: 1 addition & 1 deletion collectors/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
wg.Add(3)

go func(puns []string) {
p := NewProcessCollector(c.logger)
p := NewProcessCollector(c.logger.With("collector", "process"))
err := p.collect(puns, ch)
if err != nil {
c.logger.Error("Error collecting process information", "err", err)
Expand Down
1 change: 0 additions & 1 deletion collectors/passenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ type PassengerProcessMetrics struct {
}

func NewPassengerCollector(logger *slog.Logger) *PassengerCollector {
logger.LogAttrs(context.Background(), slog.LevelInfo, "Passenger collector", slog.String("collector", "passenger"))
return &PassengerCollector{
logger: logger,
Instances: prometheus.NewDesc(prometheus.BuildFQName(namespace, "passenger", "instances"), "Number of Passenger instances", nil, nil),
Expand Down
2 changes: 0 additions & 2 deletions collectors/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
package collectors

import (
"context"
"log/slog"
"slices"
"strconv"
Expand Down Expand Up @@ -118,7 +117,6 @@ func getProcessMetrics(puns []string, logger *slog.Logger) (ProcessMetrics, erro
}

func NewProcessCollector(logger *slog.Logger) *ProcessCollector {
logger.LogAttrs(context.Background(), slog.LevelInfo, "process collector", slog.String("collector", "process"))
return &ProcessCollector{
logger: logger,
RackApps: prometheus.NewDesc(prometheus.BuildFQName(namespace, "", "rack_apps"), "Number of running Rack apps", nil, nil),
Expand Down

0 comments on commit 3ad06d9

Please sign in to comment.