-
Notifications
You must be signed in to change notification settings - Fork 68
feat: Add structured internal logging for debugging for Geneva-uploader #472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #472 +/- ##
=======================================
- Coverage 53.7% 53.3% -0.4%
=======================================
Files 71 71
Lines 11262 11391 +129
=======================================
+ Hits 6056 6080 +24
- Misses 5206 5311 +105 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces structured internal logging for debugging across the Geneva uploader components using the tracing crate. It adds info-level logs for lifecycle events (initialization, auth token acquisition) and debug-level logs for hot-path operations (encoding, compression, uploads).
- Added comprehensive tracing throughout config client, token workflows, encoding, and upload pipeline
- Updated the basic example with detailed documentation on how to enable geneva-uploader internal logs
- Enhanced RUST_LOG environment variable handling in the example to merge user-specified directives with defaults
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 17 comments.
Show a summary per file
File | Description |
---|---|
opentelemetry-exporter-geneva/examples/basic.rs | Added documentation and improved RUST_LOG handling for geneva-uploader internal logs |
geneva-uploader/src/payload_encoder/otlp_encoder.rs | Added debug logging for encoding operations, compression errors, and batch statistics |
geneva-uploader/src/ingestion_service/uploader.rs | Added debug logging for upload lifecycle, success/failure cases, and error handling |
geneva-uploader/src/config_service/client.rs | Added comprehensive logging for auth workflows, cache operations, and config service interactions |
geneva-uploader/src/client.rs | Added info/debug logging for client initialization and batch processing operations |
geneva-uploader/Cargo.toml | Added tracing dependency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
debug!( | ||
name: "config_client.new.certificate_read_error", | ||
target: "geneva-uploader", | ||
"Failed to read certificate file: {}", e |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debug! macro should use structured logging format instead of string formatting. Use error = %e
in the macro arguments and remove the {} placeholder from the message.
Copilot uses AI. Check for mistakes.
debug!( | ||
name: "config_client.new.certificate_parse_error", | ||
target: "geneva-uploader", | ||
"Failed to parse PKCS#12 certificate: {}", e |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debug! macro should use structured logging format instead of string formatting. Use error = %e
in the macro arguments and remove the {} placeholder from the message.
Copilot uses AI. Check for mistakes.
debug!( | ||
name: "config_client.new.tls_connector_error", | ||
target: "geneva-uploader", | ||
"Failed to build TLS connector: {}", e |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debug! macro should use structured logging format instead of string formatting. Use error = %e
in the macro arguments and remove the {} placeholder from the message.
Copilot uses AI. Check for mistakes.
debug!( | ||
name: "config_client.get_workload_identity_token.create_credential_error", | ||
target: "geneva-uploader", | ||
"Failed to create WorkloadIdentityCredential: {}", e |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debug! macro should use structured logging format instead of string formatting. Use error = %e
in the macro arguments and remove the {} placeholder from the message.
"Failed to create WorkloadIdentityCredential: {}", e | |
"Failed to create WorkloadIdentityCredential", | |
error = %e |
Copilot uses AI. Check for mistakes.
"Workload Identity token acquisition failed. Scopes tried: {}. Last error: {}", | ||
scope_candidates.join(", "), detail |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debug! macro should use structured logging format instead of string formatting. Use structured fields like scopes = %scope_candidates.join(\", \"), error = %detail
in the macro arguments.
"Workload Identity token acquisition failed. Scopes tried: {}. Last error: {}", | |
scope_candidates.join(", "), detail | |
scopes = %scope_candidates.join(", "), | |
error = %detail, | |
"Workload Identity token acquisition failed" |
Copilot uses AI. Check for mistakes.
debug!( | ||
name: "client.new.uploader_init", | ||
target: "geneva-uploader", | ||
"GenevaUploader init failed: {}", e |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debug! macro should use structured logging format instead of string formatting. Use error = %e
in the macro arguments and remove the {} placeholder from the message.
"GenevaUploader init failed: {}", e | |
error = %e, | |
"GenevaUploader init failed" |
Copilot uses AI. Check for mistakes.
debug!( | ||
name: "client.encode_and_compress_logs", | ||
target: "geneva-uploader", | ||
"Encoding and compressing {} resource logs", logs.len() |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debug! macro should use structured logging format instead of string formatting. Use resource_logs_count = logs.len()
in the macro arguments and update the message to remove the {} placeholder.
"Encoding and compressing {} resource logs", logs.len() | |
resource_logs_count = logs.len(), | |
"Encoding and compressing resource logs" |
Copilot uses AI. Check for mistakes.
debug!( | ||
name: "client.encode_and_compress_logs.error", | ||
target: "geneva-uploader", | ||
"Log compression failed: {}", e |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debug! macro should use structured logging format instead of string formatting. Use error = %e
in the macro arguments and remove the {} placeholder from the message.
"Log compression failed: {}", e | |
error = %e, | |
"Log compression failed" |
Copilot uses AI. Check for mistakes.
debug!( | ||
name: "client.encode_and_compress_spans", | ||
target: "geneva-uploader", | ||
"Encoding and compressing {} resource spans", spans.len() |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debug! macro should use structured logging format instead of string formatting. Use resource_spans_count = spans.len()
in the macro arguments and update the message to remove the {} placeholder.
"Encoding and compressing {} resource spans", spans.len() | |
resource_spans_count = spans.len(), | |
"Encoding and compressing resource spans" |
Copilot uses AI. Check for mistakes.
debug!( | ||
name: "client.encode_and_compress_spans.error", | ||
target: "geneva-uploader", | ||
"Span compression failed: {}", e |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debug! macro should use structured logging format instead of string formatting. Use error = %e
in the macro arguments and remove the {} placeholder from the message.
"Span compression failed: {}", e | |
error = %e, | |
"Span compression failed" |
Copilot uses AI. Check for mistakes.
Changes
Introduce consistent, structured tracing across the Geneva uploader (config client, token workflows, encoding, upload pipeline) using
Update the opentelemetry-exporter-geneva example too to demonstrate it:
debug-logs:
info-logs:
Please provide a brief description of the changes here.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes