perf(observability): lazy-load OTEL exporter classes to reduce cold-start import time#1715
Draft
SanilK2108 wants to merge 1 commit into
Draft
perf(observability): lazy-load OTEL exporter classes to reduce cold-start import time#1715SanilK2108 wants to merge 1 commit into
SanilK2108 wants to merge 1 commit into
Conversation
…tart import time OTLPLogExporter, BatchLogRecordProcessor, and LoggerProvider are heavy imports (~177ms combined on cold overlayfs) that are only needed when ENABLE_OTLP_LOGS=true. Move them inside the conditional blocks so they are never imported on startup for the common case (OTLP disabled).
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
📜 Docstring Coverage ReportRESULT: PASSED (minimum: 30.0%, actual: 77.0%) Detailed Coverage Report |
Contributor
📦 Trivy Vulnerability Scan Results
Report SummaryCould not generate summary table (data length mismatch: 9 vs 8). Scan Result Detailsrequirements.txtuv.lock |
Contributor
📦 Trivy Secret Scan Results
Report SummaryCould not generate summary table (data length mismatch: 9 vs 8). Scan Result Detailsrequirements.txtuv.lock |
Collaborator
|
If I'm not mistaken, this is only going to have any effect on SDR deployments — we use OTLP logging (extensively) in non-SDR deployments... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduces server pod cold-start time by lazy-loading heavy OTEL imports that are only needed when
ENABLE_OTLP_LOGS=true.What changes:
OTLPLogExporter,BatchLogRecordProcessor,LoggerProvidermoved inside theif ENABLE_OTLP_LOGSconditional blocks inlogger_adaptor.py(~177ms saved on cold starts)What's already lazy in v3 (no change needed):
file_converter.py— pandas already imported inside functions ✅aws_utils.py— boto3 already underTYPE_CHECKING✅Measured impact (v2, cold overlayfs container)
Related