hyperledger-labs / fabric-smart-client

The Fabric Smart Client is a new Fabric Client that lets you focus on the business processes and simplifies the development of Fabric-based distributed application.
Apache License 2.0
51 stars 52 forks source link

Propagating Context from Microservices: A Proposal for fabric-smart-client Improvement #599

Open PERSEJOZA opened 5 months ago

PERSEJOZA commented 5 months ago

We are implementing OpenTelemetry for observability in our solution, but we have identified a blind spot. Currently, we are unable to obtain information about delays and propagate trace information. This is due to the fact that the InitiateView method of the ViewManager does not support context propagation. As a result, we are unable to create a complete and accurate picture of the system's behavior, starting from the controller or other microservices within the solution.

We would greatly benefit from the fabric-smart-client library supporting the propagation of context instead of creating a new one. This would enable the propagation of trace information from the microservice. To achieve this, we suggest either adding a new method or modifying the existing viewManager.InitiateView() method to accept a context.

arner commented 4 months ago

Implemented in https://github.com/hyperledger-labs/fabric-smart-client/commit/1564d268fe241d420137023da87d598b89a33304

arner commented 3 months ago

Opening this up again; another way to use FSC is to InitiateContext with a view first, and then pass around the resulting view.Context. That way should also support to derive a view.Context from an existing context.Context.

adecaro commented 3 months ago

@alexandrosfilios , what do you think of this?

arner commented 3 months ago

@adecaro this is resolved if we merge https://github.com/hyperledger-labs/fabric-smart-client/pull/644