Skip to content

Conversation

@lalitb
Copy link
Member

@lalitb lalitb commented Oct 14, 2025

Changes

Introduce consistent, structured tracing across the Geneva uploader (config client, token workflows, encoding, upload pipeline) using

  • info! for lifecycle/high-level state and
  • debug! for hot-path/internal decision points, and errors which are returned.

Update the opentelemetry-exporter-geneva example too to demonstrate it:

debug-logs:

% RUST_LOG=info,geneva-uploader=debug,hyper=off,reqwest=off cargo run --example basic warning: profiles for the non root package will be ignored, specify profiles at the workspace root: package: /private/tmp/opentelemetry-rust-contrib/stress/Cargo.toml workspace: /private/tmp/opentelemetry-rust-contrib/Cargo.toml Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.71s Running `/private/tmp/opentelemetry-rust-contrib/target/debug/examples/basic` WARNING: Self-signed certificates will be accepted. This should only be used in development! 2025-10-14T01:49:29.850140Z INFO main my-system: event_id=20 user_name="user1" user_email="user1@opentelemetry.io" Registration successful 2025-10-14T01:49:29.850157Z INFO main my-system: event_id=51 user_name="user2" user_email="user2@opentelemetry.io" Checkout successful 2025-10-14T01:49:29.850165Z INFO main my-system: event_id=30 user_name="user3" user_email="user3@opentelemetry.io" User login successful 2025-10-14T01:49:29.850172Z INFO main my-system: event_id=52 user_name="user2" user_email="user2@opentelemetry.io" Payment processed successfully 2025-10-14T01:49:29.850178Z ERROR main my-system: event_id=31 user_name="user4" user_email="user4@opentelemetry.io" Login failed - invalid credentials 2025-10-14T01:49:29.850184Z WARN main my-system: event_id=53 user_name="user5" user_email="user5@opentelemetry.io" Shopping cart abandoned 2025-10-14T01:49:29.850189Z INFO main my-system: event_id=32 user_name="user1" user_email="user1@opentelemetry.io" Password reset requested 2025-10-14T01:49:29.850194Z INFO main my-system: event_id=54 user_name="user2" user_email="user2@opentelemetry.io" Order shipped successfully Sleeping for 30 seconds... 2025-10-14T01:49:31.854055Z DEBUG tokio-runtime-worker geneva-uploader: Encoding and compressing 1 resource logs 2025-10-14T01:49:31.856722Z DEBUG tokio-runtime-worker geneva-uploader: Encoded log batch event_name=Log schemas=1 events=8 uncompressed_size=2928 compressed_size=1025 2025-10-14T01:49:31.856872Z DEBUG tokio-runtime-worker geneva-uploader: Uploading batch event_name=Log size=1025 2025-10-14T01:49:31.856923Z DEBUG tokio-runtime-worker geneva-uploader: Starting upload event_name=Log size=1025 2025-10-14T01:49:31.856971Z DEBUG tokio-runtime-worker geneva-uploader: Getting ingestion info (checking cache first) 2025-10-14T01:49:31.857058Z INFO tokio-runtime-worker geneva-uploader: Fetching fresh ingestion info from Geneva Config Service 2025-10-14T01:49:31.857135Z DEBUG tokio-runtime-worker geneva-uploader: Sending config request with request_id=bec0eec8-eed1-49e6-bc17-74528111013b 2025-10-14T01:49:32.109886Z DEBUG tokio-runtime-worker geneva-uploader: Config service returned success status 2025-10-14T01:49:32.110391Z INFO tokio-runtime-worker geneva-uploader: Successfully retrieved ingestion info moniker=pademo2diagbl 2025-10-14T01:49:32.110552Z DEBUG tokio-runtime-worker geneva-uploader: Posting to ingestion gateway event_name=Log moniker=pademo2diagbl 2025-10-14T01:49:33.649714Z DEBUG tokio-runtime-worker geneva-uploader: Upload successful event_name=Log ticket=v1|westeurope-0|0d2f8ede14644623a0b0e759d1f93ca1|0000000000000000|https://test1.diagnostics.monitoring.core.windows.net/-pademo2diagbl-GenevaCommon-RedirectionEvent031814-Ver2v0-134048801736504244-0000000000000000-eastus-Default 2025-10-14T01:49:33.649809Z DEBUG tokio-runtime-worker geneva-uploader: Successfully uploaded batch event_name=Log 2025-10-14T01:49:34.651679Z DEBUG tokio-runtime-worker geneva-uploader: Encoding and compressing 1 resource logs 2025-10-14T01:49:34.653703Z DEBUG tokio-runtime-worker geneva-uploader: Encoded log batch event_name=config_client.fetch_ingestion_info.success schemas=1 events=1 uncompressed_size=1366 compressed_size=674 2025-10-14T01:49:34.654569Z DEBUG tokio-runtime-worker geneva-uploader: Encoded log batch event_name=config_client.fetch_ingestion_info schemas=1 events=1 uncompressed_size=1271 compressed_size=636 2025-10-14T01:49:34.654638Z DEBUG tokio-runtime-worker geneva-uploader: Uploading batch event_name=config_client.fetch_ingestion_info.success size=674 2025-10-14T01:49:34.654664Z DEBUG tokio-runtime-worker geneva-uploader: Starting upload event_name=config_client.fetch_ingestion_info.success size=674 2025-10-14T01:49:34.654679Z DEBUG tokio-runtime-worker geneva-uploader: Getting ingestion info (checking cache first) 2025-10-14T01:49:34.654710Z DEBUG tokio-runtime-worker geneva-uploader: Using cached ingestion info expiry=2025-10-17 01:49:32.195044400 UTC 2025-10-14T01:49:34.654780Z DEBUG tokio-runtime-worker geneva-uploader: Posting to ingestion gateway event_name=config_client.fetch_ingestion_info.success moniker=pademo2diagbl 2025-10-14T01:49:34.655292Z DEBUG tokio-runtime-worker geneva-uploader: Uploading batch event_name=config_client.fetch_ingestion_info size=636 2025-10-14T01:49:34.655315Z DEBUG tokio-runtime-worker geneva-uploader: Starting upload event_name=config_client.fetch_ingestion_info size=636 2025-10-14T01:49:34.655325Z DEBUG tokio-runtime-worker geneva-uploader: Getting ingestion info (checking cache first) 2025-10-14T01:49:34.655341Z DEBUG tokio-runtime-worker geneva-uploader: Using cached ingestion info expiry=2025-10-17 01:49:32.195044400 UTC 2025-10-14T01:49:34.655385Z DEBUG tokio-runtime-worker geneva-uploader: Posting to ingestion gateway event_name=config_client.fetch_ingestion_info moniker=pademo2diagbl 2025-10-14T01:49:36.147432Z DEBUG tokio-runtime-worker geneva-uploader: Upload successful event_name=config_client.fetch_ingestion_info ticket=v1|southeastasia-0|8f66bace39a84e8fa1d70b696dfd5949|0000000000000000|https://test1.diagnostics.monitoring.core.windows.net/-pademo2diagbl-GenevaCommon-RedirectionEvent013391-Ver2v0-134048801757359652-0000000000000000-eastus-Default 2025-10-14T01:49:36.147516Z DEBUG tokio-runtime-worker geneva-uploader: Successfully uploaded batch event_name=config_client.fetch_ingestion_info 2025-10-14T01:49:36.148113Z DEBUG tokio-runtime-worker geneva-uploader: Upload successful event_name=config_client.fetch_ingestion_info.success ticket=v1|westeurope-0|0b52efcd46d648e6998dede00d84cebb|0000000000000000|https://test1.diagnostics.monitoring.core.windows.net/-pademo2diagbl-GenevaCommon-RedirectionEvent031986-Ver2v0-134048801759473498-0000000000000000-eastus-Default 2025-10-14T01:49:36.148164Z DEBUG tokio-runtime-worker geneva-uploader: Successfully uploaded batch event_name=config_client.fetch_ingestion_info.success Shutting down provider %

info-logs:

lalitb@Lalits-MacBook-Pro-2 opentelemetry-exporter-geneva % RUST_LOG=info,geneva-uploader=info,hyper=off,reqwest=off cargo run --example basic warning: profiles for the non root package will be ignored, specify profiles at the workspace root: package: /private/tmp/opentelemetry-rust-contrib/stress/Cargo.toml workspace: /private/tmp/opentelemetry-rust-contrib/Cargo.toml Compiling opentelemetry-exporter-geneva v0.2.0 (/private/tmp/opentelemetry-rust-contrib/opentelemetry-exporter-geneva/opentelemetry-exporter-geneva) Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.19s Running `/private/tmp/opentelemetry-rust-contrib/target/debug/examples/basic` WARNING: Self-signed certificates will be accepted. This should only be used in development! 2025-10-14T01:51:01.984495Z INFO main my-system: event_id=20 user_name="user1" user_email="user1@opentelemetry.io" Registration successful 2025-10-14T01:51:01.984517Z INFO main my-system: event_id=51 user_name="user2" user_email="user2@opentelemetry.io" Checkout successful 2025-10-14T01:51:01.984525Z INFO main my-system: event_id=30 user_name="user3" user_email="user3@opentelemetry.io" User login successful 2025-10-14T01:51:01.984534Z INFO main my-system: event_id=52 user_name="user2" user_email="user2@opentelemetry.io" Payment processed successfully 2025-10-14T01:51:01.984540Z ERROR main my-system: event_id=31 user_name="user4" user_email="user4@opentelemetry.io" Login failed - invalid credentials 2025-10-14T01:51:01.984546Z WARN main my-system: event_id=53 user_name="user5" user_email="user5@opentelemetry.io" Shopping cart abandoned 2025-10-14T01:51:01.984551Z INFO main my-system: event_id=32 user_name="user1" user_email="user1@opentelemetry.io" Password reset requested 2025-10-14T01:51:01.984556Z INFO main my-system: event_id=54 user_name="user2" user_email="user2@opentelemetry.io" Order shipped successfully Sleeping for 30 seconds... 2025-10-14T01:51:03.989409Z INFO tokio-runtime-worker geneva-uploader: Fetching fresh ingestion info from Geneva Config Service 2025-10-14T01:51:04.199536Z INFO tokio-runtime-worker geneva-uploader: Successfully retrieved ingestion info moniker=pademo2diagbl Shutting down provider lalitb@Lalits-MacBook-Pro-2 opentelemetry-exporter-geneva %

Please provide a brief description of the changes here.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)
@lalitb lalitb requested a review from a team as a code owner October 14, 2025 01:58
@codecov
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

❌ Patch coverage is 29.71429% with 123 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.6%. Comparing base (3ee12ab) to head (6650e1f).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...eneva/geneva-uploader/src/config_service/client.rs 29.3% 65 Missing ⚠️
...etry-exporter-geneva/geneva-uploader/src/client.rs 28.2% 33 Missing ⚠️
...eneva-uploader/src/payload_encoder/otlp_encoder.rs 36.3% 14 Missing ⚠️
.../geneva-uploader/src/ingestion_service/uploader.rs 26.6% 11 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@ ## main #472 +/- ## ======================================= - Coverage 54.0% 53.6% -0.5%  ======================================= Files 71 71 Lines 11501 11632 +131 ======================================= + Hits 6220 6244 +24  - Misses 5281 5388 +107 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@lalitb lalitb changed the title feature: Add structured internal logging for debugging for Geneva-uploader feat: Add structured internal logging for debugging for Geneva-uploader Oct 14, 2025
@lalitb lalitb requested a review from Copilot October 14, 2025 06:07
Copy link
Contributor

Copilot AI left a 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_parse_error",
target: "geneva-uploader",
"Failed to parse PKCS#12 certificate: {}", e
Copy link

Copilot AI Oct 14, 2025

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.
Copy link
Contributor

@utpilla utpilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as the changes are helpful.

A few things to note though:

  • I think we don't have consistency in the usage of debug! vs info!. I believe we want the hot-path operations to use debug! and info! for everything else. We don't seem to follow that
  • Use structured logging as suggested by Copilot
  • The examples could simply add a directive for the geneva_uploader target instead of relying on the environment variable.
@lalitb
Copy link
Member Author

lalitb commented Oct 17, 2025

I think we don't have consistency in the usage of debug! vs info!. I believe we want the hot-path operations to use debug! and info! for everything else. We don't seem to follow that

Thanks for reviewing/

We want to

  • use the debug! in the hot-path for all purpose
  • Use info! in the init/cleanup for non-error scenarios
  • Use debug! in the init/cleanup for error scenarios where error is returned to caller.

If this is not consistent, I will fix it.

lalitb and others added 11 commits October 17, 2025 10:16
…ce/client.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ce/client.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ce/client.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ce/client.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ce/client.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ce/client.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ce/client.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
lalitb and others added 5 commits October 17, 2025 10:21
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lalitb
Copy link
Member Author

lalitb commented Oct 17, 2025

@utpilla All the comments are resolved. Will be merging now, if anything left, will accommodate in next release. Thanks for reviewing.

@lalitb lalitb merged commit 0e5db5d into open-telemetry:main Oct 17, 2025
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment