Skip to content

Commit c57c5f5

Browse files
committed
fix: remove hardcoded OTEL_LOG_LEVEL DEBUG and filter parent OTEL vars
Fixes #3357
1 parent 7c95207 commit c57c5f5

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

packages/python/src/index.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,19 @@ export const python = {
8989
nodeOptions: {
9090
...(options.nodeOptions || {}),
9191
env: {
92-
...process.env,
92+
// Filter out parent OTEL vars to prevent stderr flood
93+
...Object.fromEntries(
94+
Object.entries(process.env).filter(
95+
([key]) => !key.startswith("OTEL_")
96+
)
97+
),
9398
...options.env,
9499
TRACEPARENT: carrier["traceparent"],
95100
OTEL_RESOURCE_ATTRIBUTES: `${
96101
SemanticInternalAttributes.EXECUTION_ENVIRONMENT
97102
}=trigger,${Object.entries(taskContext.attributes)
98103
.map(([key, value]) => `${key}=${value}`)
99104
.join(",")}`,
100-
OTEL_LOG_LEVEL: "DEBUG",
101105
},
102106
},
103107
throwOnError: false,
@@ -151,7 +155,12 @@ export const python = {
151155
nodeOptions: {
152156
...(options.nodeOptions || {}),
153157
env: {
154-
...process.env,
158+
// Filter out parent OTEL vars to prevent stderr flood
159+
...Object.fromEntries(
160+
Object.entries(process.env).filter(
161+
([key]) => !key.startswith("OTEL_")
162+
)
163+
),
155164
...options.env,
156165
TRACEPARENT: carrier["traceparent"],
157166
OTEL_RESOURCE_ATTRIBUTES: `${

0 commit comments

Comments
 (0)