Skip to content

Commit

Permalink
Regroup overloads.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oberon00 committed Aug 24, 2022
1 parent 6a2d20e commit d684283
Showing 1 changed file with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,28 @@ public static void Trace<TInput>(
TraceInternal(tracerProvider, action, input, context, parentContext);
}

/// <summary>
/// Tracing wrapper for Lambda handler.
/// </summary>
/// <param name="tracerProvider">TracerProvider passed in.</param>
/// <param name="lambdaHandler">Lambda handler function passed in.</param>
/// <param name="context">Instance of lambda context.</param>
/// <param name="parentContext">
/// The optional parent context <see cref="ActivityContext"/> is used for Activity object creation.
/// If no parent context provided, incoming request is used to extract one.
/// If parent is not extracted from incoming request then X-Ray propagation is used to extract one
/// unless X-Ray propagation is disabled in the configuration for this wrapper.
/// </param>
public static void Trace(
TracerProvider tracerProvider,
Action<ILambdaContext> lambdaHandler,
ILambdaContext context,
ActivityContext parentContext = default)
{
Action action = () => lambdaHandler(context);
TraceInternal<object>(tracerProvider, action, null, context, parentContext);
}

/// <summary>
/// Tracing wrapper for async Lambda handler.
/// </summary>
Expand Down Expand Up @@ -143,28 +165,6 @@ public static async Task<TResult> TraceAsync<TInput, TResult>(
return result;
}

/// <summary>
/// Tracing wrapper for Lambda handler.
/// </summary>
/// <param name="tracerProvider">TracerProvider passed in.</param>
/// <param name="lambdaHandler">Lambda handler function passed in.</param>
/// <param name="context">Instance of lambda context.</param>
/// <param name="parentContext">
/// The optional parent context <see cref="ActivityContext"/> is used for Activity object creation.
/// If no parent context provided, incoming request is used to extract one.
/// If parent is not extracted from incoming request then X-Ray propagation is used to extract one
/// unless X-Ray propagation is disabled in the configuration for this wrapper.
/// </param>
public static void Trace(
TracerProvider tracerProvider,
Action<ILambdaContext> lambdaHandler,
ILambdaContext context,
ActivityContext parentContext = default)
{
Action action = () => lambdaHandler(context);
TraceInternal<object>(tracerProvider, action, null, context, parentContext);
}

/// <summary>
/// Tracing wrapper for async Lambda handler.
/// </summary>
Expand Down

0 comments on commit d684283

Please sign in to comment.