Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logging collector attribute #29

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading