|
59 | 59 | initMutex = &sync.Mutex{} |
60 | 60 | ) |
61 | 61 |
|
62 | | -var pluginLogOrigin = slog.String("log_origin", "otel_collector_plugin.go") |
63 | | - |
64 | 62 | // NewCollector is the constructor for the Collector plugin. |
65 | 63 | func New(conf *config.Config) (*Collector, error) { |
66 | 64 | initMutex.Lock() |
@@ -412,19 +410,11 @@ func (oc *Collector) checkForNewReceivers(ctx context.Context, nginxConfigContex |
412 | 410 | CollectionInterval: defaultCollectionInterval, |
413 | 411 | }, |
414 | 412 | ) |
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") |
420 | 414 |
|
421 | 415 | reloadCollector = true |
422 | 416 | } 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") |
428 | 418 | reloadCollector = oc.addNginxOssReceiver(ctx, nginxConfigContext) |
429 | 419 | } |
430 | 420 |
|
@@ -457,11 +447,11 @@ func (oc *Collector) addNginxOssReceiver(ctx context.Context, nginxConfigContext |
457 | 447 | CollectionInterval: defaultCollectionInterval, |
458 | 448 | }, |
459 | 449 | ) |
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") |
461 | 451 |
|
462 | 452 | reloadCollector = true |
463 | 453 | } 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") |
465 | 455 | } |
466 | 456 |
|
467 | 457 | return reloadCollector |
|
0 commit comments