Skip to content

Commit 114a057

Browse files
committed
need to create the dir if not tmp?
1 parent 008684a commit 114a057

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/collector/pgbouncer.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,18 @@ func EnablePgBouncerLogging(ctx context.Context,
5959

6060
if OpenTelemetryLogsEnabled(ctx, inCluster) {
6161
directory := filepath.Dir(logfile)
62+
create_directory := false
63+
if directory != "tmp" {
64+
create_directory = true
65+
}
6266

6367
// Keep track of what log records and files have been processed.
6468
// Use a subdirectory of the logs directory to stay within the same failure domain.
6569
//
6670
// https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/-/extension/storage/filestorage#readme
6771
outConfig.Extensions["file_storage/pgbouncer_logs"] = map[string]any{
6872
"directory": directory + "/receiver",
69-
"create_directory": false,
73+
"create_directory": create_directory,
7074
"fsync": true,
7175
}
7276

0 commit comments

Comments
 (0)