Skip to content

Conversation

@eudelins-zama
Copy link
Contributor

@eudelins-zama eudelins-zama commented Oct 8, 2025

Closes https://github.com/zama-ai/fhevm-internal/issues/475

Here's what it looks like:
Screenshot From 2025-10-08 09-50-18

Only issue is that the parent span's duration is not shown as the sum of the 3 child spans. This is because the handle_gateway_event span is automatically closed when the function exit (implementation of the tracing crate).

I spent some time digging this, and the only way I see to resolve this would be to implement a way for tx-sender to warn gw-listener that he finished its job (grpc call for instance), and to only exit the handle_gateway_event when the gw-listener receive the ping from the tx-sender. It might be a bit overkill for now, I asked @leventdem about this and we decided to postpone this for now, and merge this as it is.

@eudelins-zama eudelins-zama requested a review from Copilot October 8, 2025 07:55
@cla-bot cla-bot bot added the cla-signed label Oct 8, 2025
Copy link

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 implements shared OTLP (OpenTelemetry) context propagation across the KMS connector services to enable distributed tracing. The changes add tracing context to database models and propagate it through the event processing pipeline from gateway events to KMS responses.

  • Refactored GatewayEvent and KmsResponse from enums to structs containing kind and otlp_context fields
  • Added PropagationContext type for serializing/deserializing OpenTelemetry trace context
  • Updated database schema to store OTLP context in all event and response tables

Reviewed Changes

Copilot reviewed 22 out of 38 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
kms-connector/crates/utils/src/types/mod.rs Made gw_event and kms_response modules public and exported new types
kms-connector/crates/utils/src/types/kms_response.rs Refactored KmsResponse to struct with kind and otlp_context fields
kms-connector/crates/utils/src/types/gw_event.rs Refactored GatewayEvent to struct with kind and otlp_context fields
kms-connector/crates/utils/src/monitoring/otlp.rs Added PropagationContext type for OTLP context serialization
Multiple test files Updated tests to work with new struct-based event/response types
Database migration Added otlp_context columns to all event and response tables
Files not reviewed (15)
  • kms-connector/.sqlx/query-1a43a1973631354ba7c92764223b8acaaba30982fbf37619f9982ee5adac8b04.json: Language not supported
  • kms-connector/.sqlx/query-2006d0c6aa7ad4945af0ae9d6fa99d64f62543158c13f34b0096e56357539ba1.json: Language not supported
  • kms-connector/.sqlx/query-3632e17b59f53983cc2f385caf05b37d8f730eef72776bee1de3356a605b0714.json: Language not supported
  • kms-connector/.sqlx/query-39c059ee786b91cdda4288eecc1af69b8166dc79e4754ca74ee373c1cfaa5066.json: Language not supported
  • kms-connector/.sqlx/query-3c1d97d4cb3eb8a3c1c3f5dccc6beca0425152e8b77ec40041502f0b8e57c058.json: Language not supported
  • kms-connector/.sqlx/query-870dd150166705cc721622e07679ab492649be1199934f92708fece4df95b8ff.json: Language not supported
  • kms-connector/.sqlx/query-8999cf2e601ad18a848f118ca5131dc3e9a5d4176f5f92bbceec770043c36baf.json: Language not supported
  • kms-connector/.sqlx/query-b349bf7c7e98d7cb858654f939fe6733b7fb1774e80cdc0b1a48cfa5cde4c521.json: Language not supported
  • kms-connector/.sqlx/query-cfa5dec1bb7a0a586b6822fd222bb518762f67fd7484c4efd1fb5320268f4341.json: Language not supported
  • kms-connector/.sqlx/query-d2b33c24cd185f97f5810a4b3da91565c87fed9d1697d651f5e51ffbba756bd6.json: Language not supported
  • kms-connector/.sqlx/query-d3238c10e01dbc5d2c06e409a9af2018b4770de5ee42126407a8276c7f54145f.json: Language not supported
  • kms-connector/.sqlx/query-d6df03a7c7617fb4ac99be6a98fd7fa4368b8b78709f3b07fba773d49ae219fe.json: Language not supported
  • kms-connector/.sqlx/query-daa213ba26085a6b864c60726c3e8a4d548bfd09d0791505fc3db89a6ee7f343.json: Language not supported
  • kms-connector/.sqlx/query-f63cbf98d0c26a3ffbd4c9080549ac15911c81f352d86f33ee79c0b244765ac7.json: Language not supported
  • kms-connector/.sqlx/query-fb044e1f8fc652401b00b59ef041debded52e491cf85e3c23e660dd2af5380aa.json: Language not supported

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

@eudelins-zama eudelins-zama force-pushed the simon/feat/shared-otlp-context branch from 99d4656 to da2b46d Compare October 8, 2025 08:05
@eudelins-zama eudelins-zama force-pushed the simon/feat/shared-otlp-context branch from da2b46d to 3c663a9 Compare October 8, 2025 08:12
@eudelins-zama eudelins-zama marked this pull request as ready for review October 8, 2025 08:16
@eudelins-zama eudelins-zama self-assigned this Oct 8, 2025
Copy link
Collaborator

@dartdart26 dartdart26 left a comment

Choose a reason for hiding this comment

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

Looks good!

@eudelins-zama eudelins-zama merged commit dd4afa5 into main Oct 8, 2025
123 checks passed
@eudelins-zama eudelins-zama deleted the simon/feat/shared-otlp-context branch October 8, 2025 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants