-
Notifications
You must be signed in to change notification settings - Fork 4
Tracing, Log Correlation
In this section we explain how you can hook your own trace implementation into the trace subsystem.
If you need, you can write your own implementation for tracing / log correlation.
As a good point to start you may take a look at class ...logging.simpleTrace.SimpleTraceContext
.
Your trace implementation must implement interface ...logging.TraceContext
and declared to be a named component with prototype scope.
The name you provide for the component must then be configured in the master configuration file.
Example:
@Component("myTrace")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class MyTraceContext implements TraceContext {...}
Study the Javadoc of ...logging.TraceContext
to understand under what conditions the methods are invoked by OAG. Implement them accordingly.
If you do not support some of the common configuration settings in the traceProfile
:
- Return the value matching the intention of your implementation. E.g. if your implementation does not support upstream trace id communication, make sure you hardcode
return false;
in thesendTraceResponse
method implementation. - Document this in Javadoc of your class (recommended)
The name you provided for the component must be configured in the master configuration file, section traceProfile
, attribute type
in order to be used by OAG.
For the example provided above, the required configuration is:
traceProfile:
type: myTrace
...
Write tests to verify functionality of your trace implementation. Start OAG and verify your trace id is found in the log and sent to downstream and upstream systems as required.
This Wiki contains the documentation of the OWASP Application Gateway (OAG). If you think that we missed something please add an issue on GitHub.
- Wiki Home
There is also a Swagger documentation of all OAG endpoint available online: https://app.swaggerhub.com/apis-docs/gianlucafrei/OAG/0.4#/