Skip to content

Conversation

DeshErBojhaa
Copy link
Contributor

@DeshErBojhaa DeshErBojhaa commented Aug 20, 2025

Description

💀 Similar Files

docs/tracing.md and docs/logging.md slightly overlap. Since both tracing and logging sometimes share similar characteristics and their responsibilities are also close, we need to decide whether and how to merge these two files.


closes: IBC-145

🔴 Please read

  • The purpose of this PR is to introduce tracing while avoiding code modification (as much as possible).
  • Not implemented fine-grained tracing for the sake of keeping the implementation unchanged. The pros of having fine-grained tracing do not outweigh making changes to the code.
  • The only exception is the start function, which requires extensive tracing.

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Wrote unit and integration tests.
  • Added relevant natspec and godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

Copy link

linear bot commented Aug 20, 2025

@DeshErBojhaa DeshErBojhaa self-assigned this Aug 20, 2025
@DeshErBojhaa DeshErBojhaa marked this pull request as draft August 20, 2025 14:52
Copy link

codecov bot commented Aug 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.86%. Comparing base (2bf3eec) to head (de96759).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #681   +/-   ##
=======================================
  Coverage   99.86%   99.86%           
=======================================
  Files          17       17           
  Lines         767      767           
=======================================
  Hits          766      766           
  Misses          1        1           

☔ 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.

@gjermundgaraba gjermundgaraba requested a review from Copilot August 20, 2025 18:33
Copy link
Contributor

@Copilot 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 distributed tracing capabilities to the relayer while minimizing code modifications. The implementation adds OpenTelemetry support with OTLP export alongside traditional stdout logging, moving tracing configuration from the server config to a dedicated tracing configuration section.

  • Adds new tracing module with OpenTelemetry OTLP support and configurable logging
  • Updates tracing attributes across relayer modules to include error debugging information
  • Migrates log level configuration from server config to dedicated tracing config section

Reviewed Changes

Copilot reviewed 22 out of 25 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
programs/relayer/src/tracing.rs New tracing configuration module with OpenTelemetry OTLP support
programs/relayer/config.example.json Updates configuration format to use dedicated tracing section
packages/relayer/core/src/config.rs Moves tracing config from server config to dedicated TracingConfig struct
packages/relayer/core/src/builder.rs Enhances instrumentation in relayer startup and request handling
Multiple module files Updates tracing attributes to include error debugging across relayer modules

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@gjermundgaraba
Copy link
Contributor

gjermundgaraba commented Aug 20, 2025

This task was only for the relayer and should target main. You can split out the attestor tracing and put that into a separate PR when this has been merged to main and then backported to feat/ibc-attestor. I will only review the relayer part now.

Edit: I see now that there are only minor changes to the attestor part, which is good. But please target main for this.

Copy link
Contributor

@gjermundgaraba gjermundgaraba left a comment

Choose a reason for hiding this comment

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

This is a good start, left a few comments, but I also wonder about issue (IBC-145): it states a couple of definitions of done that I am not sure is fulfilled here. Please make sure that it is.

@DeshErBojhaa DeshErBojhaa changed the base branch from feat/ibc-attestor to main August 21, 2025 10:47
@DeshErBojhaa DeshErBojhaa force-pushed the tamjid/tracing branch 2 times, most recently from 9f159f4 to b989964 Compare August 21, 2025 11:22
@gjermundgaraba gjermundgaraba requested a review from Copilot August 21, 2025 14:33
@DeshErBojhaa DeshErBojhaa marked this pull request as ready for review August 21, 2025 14:52
Copilot

This comment was marked as outdated.

@gjermundgaraba gjermundgaraba requested a review from Copilot August 22, 2025 10:47
Copilot

This comment was marked as outdated.

@gjermundgaraba gjermundgaraba requested a review from Copilot August 25, 2025 13:31
Copilot

This comment was marked as outdated.

Copy link
Contributor

@Copilot 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 adds distributed tracing capability to the IBC Eureka relayer to improve observability and debugging in distributed systems. The implementation leverages OpenTelemetry standards for trace collection and propagation across service boundaries.

  • Introduces observability configuration with optional OTLP export for distributed tracing
  • Adds automatic trace context propagation for gRPC services using interceptors
  • Includes local Grafana stack setup for development and testing

Reviewed Changes

Copilot reviewed 34 out of 38 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
programs/relayer/src/observability.rs Core observability module with OTLP tracer/logger setup
packages/relayer/lib/src/utils/tracing_layer.rs gRPC interceptor for automatic trace context extraction
packages/relayer/core/src/builder.rs Integration of tracing interceptor with gRPC server
packages/relayer/core/src/config.rs Configuration structure for observability settings
scripts/local-grafana-stack/ Complete local observability stack with Grafana, Tempo, and Prometheus
Various module files Enhanced tracing attributes for better error context

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}
if let Some(provider) = self.otel_logger_provider.take() {
// There is no shutdown on SdkLoggerProvider in 0.30; drop flushes processors.
let _ = provider;
Copy link

Copilot AI Aug 26, 2025

Choose a reason for hiding this comment

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

The comment indicates there's no shutdown method in 0.30, but using let _ = provider; makes the intent unclear. Consider using drop(provider); to explicitly show intentional disposal or add a more descriptive comment explaining why the variable is being discarded.

Suggested change
let _ = provider;
drop(provider);

Copilot uses AI. Check for mistakes.


let provider = setup_otlp_logger(&config);
assert!(provider.is_ok());
drop(provider);
Copy link

Copilot AI Aug 26, 2025

Choose a reason for hiding this comment

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

These explicit drop() calls in tests are unnecessary since variables would be dropped automatically at the end of their scope. Consider removing them for cleaner test code.

Suggested change
drop(provider);

Copilot uses AI. Check for mistakes.


let tracer_provider = setup_otlp_tracer(&config);
assert!(tracer_provider.is_ok());
drop(tracer_provider);
Copy link

Copilot AI Aug 26, 2025

Choose a reason for hiding this comment

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

These explicit drop() calls in tests are unnecessary since variables would be dropped automatically at the end of their scope. Consider removing them for cleaner test code.

Suggested change
drop(tracer_provider);

Copilot uses AI. Check for mistakes.

@gjermundgaraba gjermundgaraba removed their request for review October 8, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants