Skip to content
231 changes: 0 additions & 231 deletions src/MinimalLambda.OpenTelemetry/LambdaOpenTelemetryAdapters.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,6 @@ is CSharpCompilation
.Where(static m => m is not null)
.Select(static (m, _) => m!.Value);

// find any calls to `UseOpenTelemetryTracing` and extract the location
var openTelemetryTracingCalls = context
.SyntaxProvider.CreateSyntaxProvider(
UseOpenTelemetryTracingSyntaxProvider.Predicate,
UseOpenTelemetryTracingSyntaxProvider.Transformer
)
.Where(static m => m is not null)
.Select(static (m, _) => m!.Value);

// find LambdaApplicationBuilder.Build() calls
var lambdaApplicationBuilderBuildCalls = context
.SyntaxProvider.CreateSyntaxProvider(
Expand All @@ -99,31 +90,27 @@ is CSharpCompilation
var mapHandlerCallsCollected = mapHandlerCalls.Collect();
var onShutdownCallsCollected = onShutdownCalls.Collect();
var onInitCallsCollected = onInitCalls.Collect();
var openTelemetryTracingCallsCollected = openTelemetryTracingCalls.Collect();
var lambdaApplicationBuilderBuildCallsCollected =
lambdaApplicationBuilderBuildCalls.Collect();

// combine the compilation and map handler calls
var combined = mapHandlerCallsCollected
.Combine(onShutdownCallsCollected)
.Combine(onInitCallsCollected)
.Combine(openTelemetryTracingCallsCollected)
.Combine(lambdaApplicationBuilderBuildCallsCollected)
.Select(
CompilationInfo? (t, _) =>
{
if (
t.Left.Left.Left.Left.Length == 0
&& t.Left.Left.Left.Right.Length == 0
t.Left.Left.Left.Length == 0
&& t.Left.Left.Right.Length == 0
&& t.Left.Right.Length == 0
&& t.Right.Length == 0
)
return null;

return new CompilationInfo(
t.Left.Left.Left.Left.ToEquatableArray(),
t.Left.Left.Left.Right.ToEquatableArray(),
t.Left.Left.Left.ToEquatableArray(),
t.Left.Left.Right.ToEquatableArray(),
t.Left.Right.ToEquatableArray(),
t.Right.ToEquatableArray()
Expand Down
3 changes: 1 addition & 2 deletions src/MinimalLambda.SourceGenerators/Models/CompilationInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ internal readonly record struct CompilationInfo(
EquatableArray<HigherOrderMethodInfo> MapHandlerInvocationInfos,
EquatableArray<HigherOrderMethodInfo> OnShutdownInvocationInfos,
EquatableArray<HigherOrderMethodInfo> OnInitInvocationInfos,
EquatableArray<SimpleMethodInfo> UseOpenTelemetryTracingInfos,
EquatableArray<SimpleMethodInfo> BuilderInfos = default
EquatableArray<SimpleMethodInfo> BuilderInfos
);
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ is IInvocationOperation
{
Name: "Builder",
ContainingNamespace:
{
Name: "Host",
ContainingNamespace:
{ Name: "AwsLambda", ContainingNamespace.IsGlobalNamespace: true },
},
{ Name: "MinimalLambda", ContainingNamespace.IsGlobalNamespace: true },
},
},
} targetOperation
Expand Down

This file was deleted.

16 changes: 0 additions & 16 deletions src/MinimalLambda/Core/Options/LambdaHostOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,6 @@ namespace MinimalLambda.Options;
/// <summary>Options for configuring Lambda hosting behavior.</summary>
public class LambdaHostOptions
{
/// <summary>Gets or sets an optional custom HTTP client for the Lambda bootstrap.</summary>
/// <remarks>
/// When null, the bootstrap will create its own HTTP client for communicating with the Lambda
/// runtime API. This property will be overridden by keyed service registrations from
/// <see cref="LambdaHttpClientServiceCollectionExtensions.AddLambdaBootstrapHttpClient" /> or
/// <see cref="LambdaHttpClientServiceCollectionExtensions.TryAddLambdaBootstrapHttpClient" />
/// extension methods.
/// </remarks>
[Obsolete(
"This property will be removed in version 2.0.0. Use "
+ "AddLambdaBootstrapHttpClient() or TryAddLambdaBootstrapHttpClient() extension methods "
+ "instead.",
false
)]
public HttpClient? BootstrapHttpClient { get; set; } = null;

/// <summary>Gets or sets the options for configuring the Lambda bootstrap behavior.</summary>
/// <remarks>
/// <para>
Expand Down
8 changes: 1 addition & 7 deletions src/MinimalLambda/Runtime/LambdaBootstrapAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ public LambdaBootstrapAdapter(
{
ArgumentNullException.ThrowIfNull(lambdaHostSettings);

// TODO: Remove this check once ILambdaBootstrapOrchestrator.BootstrapHttpClient is removed.
// until ILambdaBootstrapOrchestrator.BootstrapHttpClient is removed, we need to check for
// it if the keyed service is NOT present.
#pragma warning disable CS0618 // Type or member is obsolete
_httpClient = httpClient ?? lambdaHostSettings.Value.BootstrapHttpClient;
#pragma warning restore CS0618 // Type or member is obsolete

_httpClient = httpClient;
_settings = lambdaHostSettings.Value;
}

Expand Down
Loading
Loading