Add request response logging and execution context#44
Merged
Conversation
boma96
reviewed
Sep 5, 2022
boma96
reviewed
Sep 5, 2022
boma96
reviewed
Sep 5, 2022
Collaborator
Author
|
Added a pipeline builder, the ordering can still be bypassed with direct registrations. I would like to maybe disable this in the future and force all pipeline registrations through this method somehow. builder.AddConductorSharp(
baseUrl: configuration.GetValue<string>("Conductor:BaseUrl"),
apiPath: configuration.GetValue<string>("Conductor:ApiUrl"),
preventErrorOnBadRequest: configuration.GetValue<bool>("Conductor:PreventErrorOnBadRequest")
)
.AddExecutionManager(
maxConcurrentWorkers: configuration.GetValue<int>("Conductor:MaxConcurrentWorkers"),
sleepInterval: configuration.GetValue<int>("Conductor:SleepInterval"),
longPollInterval: configuration.GetValue<int>("Conductor:LongPollInterval"),
domain: configuration.GetValue<string>("Conductor:WorkerDomain")
)
.AddPipelines(pipelines =>
{
pipelines.AddRequestResponseLogging();
pipelines.AddValidation();
});The old way is still supported, but will report a warning that the method has been deprecated /// <summary>
/// This method is deprecated. Use AddConductorSharp method instead. WARNING: AddExecutionManager method will change when you move to AddConductorSharp,
/// it will no longer register validation pipeline by default, and you will have to do it manually using the AddPipelines method. Check
/// <see href="https://github.com/codaxy/conductor-sharp/blob/master/examples/ConductorSharp.ApiEnabled/Extensions/HostConfiguration.cs">example</see>.
/// </summary>
/// <param name="builder"></param>
/// <param name="baseUrl"></param>
/// <param name="apiPath"></param>
/// <param name="preventErrorOnBadRequest"></param>
/// <param name="createClient"></param>
/// <returns></returns>
[Obsolete("Use AddConductorSharp method instead")]
public static IWorkflowEngineBuilder AddWorkflowEngine( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a method to the workflow engine execution manager which adds request and response logging. The logging behavior logs request and response models, execution time, and execution context.
The execution context contains workflow id, name as well as task i and name. It should help us with filtering logs.