Per-Instrumentation Configuration via Environment Variables
Maintainer thường phản hồi trong vòng 2 ngày
@wpessers đang làm issue này rồi.
Từ ngày 30/11/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Is your feature request related to a problem? Please describe.
Yes. Currently, users cannot configure instrumentation-specific options (like GraphQLInstrumentation.mergeItems, PinoInstrumentation.disableLogSending, etc.) without using global.configureInstrumentations(), which requires code changes and defeats the "zero-code" promise.
The problem: When you define global.configureInstrumentations(), it completely replaces the default instrumentation system. You must manually import and configure ALL instrumentations you want, and OTEL_NODE_ENABLED_INSTRUMENTATIONS is ignored.
Example: To configure GraphQL with mergeItems: true while keeping http, grpc, pg, pino enabled, you must manually import and configure all 5 instrumentations in code, even though you only want to customize GraphQL.
// Must be at the top of handler file, before any imports
global.configureInstrumentations = async () => {
// Must import ALL instrumentations manually
const { GraphQLInstrumentation } = await import(
"@opentelemetry/instrumentation-graphql"
);
const { HttpInstrumentation } = await import(
"@opentelemetry/instrumentation-http"
);
const { GrpcInstrumentation } = await import(
"@opentelemetry/instrumentation-grpc"
);
const { PgInstrumentation } = await import(
"@opentelemetry/instrumentation-pg"
);
const { PinoInstrumentation } = await import(
"@opentelemetry/instrumentation-pino"
);
return [
new GraphQLInstrumentation({ mergeItems: true }), // Only GraphQL needs custom config
new HttpInstrumentation(), // But must still include all others
new GrpcInstrumentation(),
new PgInstrumentation(),
new PinoInstrumentation(),
];
};
Describe the solution you'd like
Add support for OTEL_INSTRUMENTATION_CONFIGS environment variable that accepts a JSON object mapping instrumentation names to their configurations. This works alongside OTEL_NODE_ENABLED_INSTRUMENTATIONS:
# Environment variables only - no code changes needed!
OTEL_NODE_ENABLED_INSTRUMENTATIONS="graphql,http,grpc,pg,pino"
OTEL_INSTRUMENTATION_CONFIGS={"graphql":{"mergeItems":true},"pino":{"disableLogSending":true}}
This would:
- Use
OTEL_NODE_ENABLED_INSTRUMENTATIONSto determine which instrumentations to load (existing behavior) - Apply configuration from
OTEL_INSTRUMENTATION_CONFIGSto respective instrumentations - Use defaults for instrumentations not specified in the config
Implementation: Add loadInstrumentationConfigs() function to parse the env var, and update defaultConfigureInstrumentations() in nodejs/packages/layer/src/wrapper.ts to merge user configs with defaults when creating instrumentations.
Describe alternatives you've considered
- Per-instrumentation environment variables (e.g.,
OTEL_PINO_CONFIG) - Rejected: Would pollute env vars and doesn't scale with 30+ instrumentations - Keep current
global.configureInstrumentations()approach - Rejected: Requires code changes, breaks zero-code promise - Configuration file - Rejected: Environment variables are more standard for Lambda and work better with AWS Systems Manager Parameter Store/Secrets Manager
Additional context
Benefits:
- True zero-code configuration via environment variables
- Works seamlessly with existing
OTEL_NODE_ENABLED_INSTRUMENTATIONS - Fully backwards compatible
- No code changes required in Lambda functions
Affected instrumentations: All 30+ instrumentations in the layer
Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
- Ngôn ngữ chính
- Go
- Star
- 433
- Fork
- 249
- Merge trung bình
- 1 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 39
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của open-telemetry/opentelemetry-lambda
-
enhancement ruby
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
open-telemetry/opentelemetry-lambda#2741 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
processor/cold_start
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
open-telemetry/opentelemetry-lambda#2738 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Fix install-toolsĐang mởgo
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
open-telemetry/opentelemetry-lambda#2736 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Use node-sdk package for layerĐang mởenhancement javascript
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
open-telemetry/opentelemetry-lambda#2744 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement python
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
open-telemetry/opentelemetry-lambda#2742 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của open-telemetry/opentelemetry-lambda
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
php/frankenphp#2829 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
teradata-labs/loom#624 ·
Maintainer thường phản hồi trong vòng 1 ngày