fnproject / fdk-java

Java API and runtime for fn.
Apache License 2.0
142 stars 53 forks source link

Add support for Oracle Cloud Infrastructure tracing solution by providing a tracing context #255

Closed hhexo closed 3 years ago

hhexo commented 3 years ago

Overview Oracle Functions will soon release a feature providing an integration with the Oracle Application Performance Monitoring (APM) service. This service supports the sending of Zipkin formatted tracing data to a collector endpoint.

The service will provide the function code with data which includes:

This information is accessible by the function code in a Tracing Context provided by the FDK.

This change has no effect on existing functions, except that the keys "OCI_TRACING_ENABLED" and "OCI_TRACE_COLLECTOR_URL" are now reserved for this tracing integration and cannot be used for function configuration.

FDK Specific Changes This change adds a TracingContext interface that users can use as a parameter of their function (much like the HTTPGatewayContext) to have access to the configuration data that Zipkin would need (i.e. a collector URL) and the headers data involved with tracing (for Zipkin, the "B3 Headers").

Once the Oracle Functions integration with APM is complete, users will be able to enable tracing for their functions and in that case the TracingContext will report isTracingEnabled() == true and will return the right data for each of its methods.