Skip to content

Commit 24b348f

Browse files
author
CircleCI
committed
stop using opentelemetry.sdk._logs._internal scope for app logs
1 parent 0422a56 commit 24b348f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tests/kubernetes-distros/kind/apps/python/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import logging
44
import json
55

6-
logger = logging.getLogger("test")
6+
logger = logging.getLogger("my-test-logger")
77
logger.setLevel(logging.INFO)
88

99
# Non-mandatory in our OTEL setup, but recommended for troubleshooting - adds a console handler to see the logs in the console

tests/kubernetes-distros/kind/lumigooperator_logs_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ func TestLumigoOperatorLogsEventsAndObjects(t *testing.T) {
439439

440440
return ctx
441441
}).
442-
Assess("Application logs are collected successfully and added k8s.* attributes", func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
442+
Assess("Application logs are collected successfully via instrumentation and added k8s.* attributes", func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
443443
otlpSinkDataPath := ctx.Value(internal.ContextKeyOtlpSinkDataPath).(string)
444444
logsPath := filepath.Join(otlpSinkDataPath, "logs.json")
445445

@@ -473,7 +473,7 @@ func TestLumigoOperatorLogsEventsAndObjects(t *testing.T) {
473473

474474
if len(applicationLogs) < 1 {
475475
// No application logs received yet
476-
t.Fatalf("No application logs found in '%s'. \r\nMake sure the application has LUMIGO_ENABLE_LOGS=true and is emitting logs using a supported logger", logsPath)
476+
t.Logf("No application logs found in '%s'. \r\nMake sure the application has LUMIGO_ENABLE_LOGS=true and is emitting logs using a supported logger", logsPath)
477477
return false, nil
478478
}
479479

@@ -519,7 +519,7 @@ func TestLumigoOperatorLogsEventsAndObjects(t *testing.T) {
519519

520520
if len(applicationLogs) < 1 {
521521
// No application logs received yet
522-
t.Fatalf("No application logs found in '%s'. \r\nMake sure log files are emitted under /var/logs/pods/ in the cluster node", logsPath)
522+
t.Logf("No application logs found in '%s'. \r\nMake sure log files are emitted under /var/logs/pods/ in the cluster node", logsPath)
523523
return false, nil
524524
}
525525

@@ -959,7 +959,8 @@ func createAndDeleteTempDeployment(ctx context.Context, config *envconf.Config,
959959
}
960960

961961
func filterApplicationLogRecords(resourceLogs plog.ResourceLogs) ([]plog.LogRecord, error) {
962-
return resourceLogsToScopedLogRecords(resourceLogs, "opentelemetry.sdk._logs._internal", "*", "*")
962+
scopeLoggerName := "my-test-logger" // The logger name is hardcoded in the app.py file deployed to the cluster
963+
return resourceLogsToScopedLogRecords(resourceLogs, scopeLoggerName, "*", "*")
963964
}
964965

965966
func filterHeartbeatLogRecords(resourceLogs plog.ResourceLogs) ([]plog.LogRecord, error) {

0 commit comments

Comments
 (0)