Skip to content

Commit bd834fb

Browse files
committed
Remove log origin from logs
1 parent 1c14889 commit bd834fb

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

internal/collector/otel_collector_plugin.go

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ var (
5959
initMutex = &sync.Mutex{}
6060
)
6161

62-
var pluginLogOrigin = slog.String("log_origin", "otel_collector_plugin.go")
63-
6462
// NewCollector is the constructor for the Collector plugin.
6563
func New(conf *config.Config) (*Collector, error) {
6664
initMutex.Lock()
@@ -412,19 +410,11 @@ func (oc *Collector) checkForNewReceivers(ctx context.Context, nginxConfigContex
412410
CollectionInterval: defaultCollectionInterval,
413411
},
414412
)
415-
slog.DebugContext(
416-
ctx,
417-
"NGINX Plus API found, NGINX Plus receiver enabled to scrape metrics",
418-
pluginLogOrigin,
419-
)
413+
slog.DebugContext(ctx, "NGINX Plus API found, NGINX Plus receiver enabled to scrape metrics")
420414

421415
reloadCollector = true
422416
} else if nginxConfigContext.PlusAPI.URL == "" {
423-
slog.WarnContext(
424-
ctx,
425-
"NGINX Plus API is not configured, searching for stub status endpoint",
426-
pluginLogOrigin,
427-
)
417+
slog.WarnContext(ctx, "NGINX Plus API is not configured, searching for stub status endpoint")
428418
reloadCollector = oc.addNginxOssReceiver(ctx, nginxConfigContext)
429419
}
430420

@@ -457,11 +447,11 @@ func (oc *Collector) addNginxOssReceiver(ctx context.Context, nginxConfigContext
457447
CollectionInterval: defaultCollectionInterval,
458448
},
459449
)
460-
slog.DebugContext(ctx, "Stub status endpoint found, OSS receiver enabled to scrape metrics", pluginLogOrigin)
450+
slog.DebugContext(ctx, "Stub status endpoint found, OSS receiver enabled to scrape metrics")
461451

462452
reloadCollector = true
463453
} else if nginxConfigContext.StubStatus.URL == "" {
464-
slog.WarnContext(ctx, "Stub status endpoint not found, NGINX metrics not available", pluginLogOrigin)
454+
slog.WarnContext(ctx, "Stub status endpoint not found, NGINX metrics not available")
465455
}
466456

467457
return reloadCollector

0 commit comments

Comments
 (0)