Lumigo.DotNET
1.0.51
dotnet add package Lumigo.DotNET --version 1.0.51
NuGet\Install-Package Lumigo.DotNET -Version 1.0.51
<PackageReference Include="Lumigo.DotNET" Version="1.0.51" />
paket add Lumigo.DotNET --version 1.0.51
#r "nuget: Lumigo.DotNET, 1.0.51"
// Install Lumigo.DotNET as a Cake Addin #addin nuget:?package=Lumigo.DotNET&version=1.0.51 // Install Lumigo.DotNET as a Cake Tool #tool nuget:?package=Lumigo.DotNET&version=1.0.51
Easily trace your .NET Lambda functions using the Lumigo platform 🚀
Supported Runtimes
- .NET Core 3.1
- .NET 6
- .NET 8
Setup
Installation
Add the Lumigo tracer package via NuGet by running:
dotnet add package Lumigo.DotNET
Wrapping Your Lambda
Wrap your lambda function by implementing a supplier which contains your code:
Synchronous handler
using Lumigo.DotNET;
using Lumigo.DotNET.Instrumentation;
...
public class Function : LumigoRequestHandler
{
public Response FunctionHandler(string input, ILambdaContext context)
{
return Handle(input, context, () =>
{
//Your lambda code
//return <result>; - For void functions remove the return statements
});
}
}
Asynchronous handler
using Lumigo.DotNET;
using Lumigo.DotNET.Instrumentation;
...
public class Function : LumigoRequestHandler
{
public async Task<Response> FunctionHandler(string input, ILambdaContext context)
{
return await Handle(input, context, async () =>
{
//Your lambda code
//return <result>; - For void functions remove the return statements
});
}
}
Execution Tags
Execution tags allow you to dynamically add dimensions to your Lambda function invocations so that they can be identified, searched for, and filtered in Lumigo. They can be utilized to find specific invocations and create custom widgets, helping you simplify the complexity of monitoring distributed applications. The Quick Bytes video for Execution Tags video gives examples of use-cases for execution tags.
Adding an execution tag to a Lambda invocation is done via the LumigoRequestHandler.AddExecutionTag
API:
using Amazon.Lambda.Core;
using Lumigo.DotNET;
using Lumigo.DotNET.Instrumentation;
using Lumigo.DotNET.Utilities.Extensions;
using System.Net.Http;
[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
namespace HelloDotNet6 {
public class Function : LumigoRequestHandler
{
public async Task<string> Handler(string input, ILambdaContext context)
{
return await Handle(input, context, async () =>
{
this.AddExecutionTag("Key1", "Value1");
return "\"Hello world\"";
}
);
}
}
}
It is possible to set multiple execution tags for the same Lambda invocation, as well as multiple values for the same execution tag:
using Amazon.Lambda.Core;
using Lumigo.DotNET;
using Lumigo.DotNET.Instrumentation;
using Lumigo.DotNET.Utilities.Extensions;
using System.Net.Http;
[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
namespace HelloDotNet6 {
public class Function : LumigoRequestHandler
{
public async Task<string> Handler(string input, ILambdaContext context)
{
return await Handle(input, context, async () =>
{
this.AddExecutionTag("Key1", "Value1");
this.AddExecutionTag("Key2", "Value2");
this.AddExecutionTag("Key2", "Value3");
return "\"Hello world\"";
}
);
}
}
}
Connect Your Lumigo Account
Add LUMIGO_TRACER_TOKEN
environment variable to connect the tracing to your Lumigo account.
Track HTTP Requests
To track HTTP requests add UseLumigo
to the HTTP client:
using Amazon.Lambda.Core;
using Lumigo.DotNET;
using Lumigo.DotNET.Instrumentation;
using Lumigo.DotNET.Utilities.Extensions;
using System.Net.Http;
[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
namespace HelloDotNet6 {
public class Function : LumigoRequestHandler
{
public async Task<string> Handler(string input, ILambdaContext context)
{
return await Handle(input, context, async () =>
{
HttpResponseMessage response = await new HttpClient().UseLumigo().GetAsync("https://httpbin.org/status/200");
response.EnsureSuccessStatusCode();
return "\"Hello world\"";
}
);
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Amazon.AspNetCore.DataProtection.SSM (>= 2.1.0)
- Amazon.Extensions.CognitoAuthentication (>= 2.2.2)
- Amazon.Lambda.APIGatewayEvents (>= 2.4.0)
- Amazon.Lambda.CloudWatchEvents (>= 3.0.0)
- Amazon.Lambda.CloudWatchLogsEvents (>= 2.1.0)
- Amazon.Lambda.CognitoEvents (>= 2.0.0)
- Amazon.Lambda.ConfigEvents (>= 2.0.0)
- Amazon.Lambda.Core (>= 2.0.0)
- Amazon.Lambda.DynamoDBEvents (>= 2.0.0)
- Amazon.Lambda.KinesisAnalyticsEvents (>= 2.2.1)
- Amazon.Lambda.KinesisEvents (>= 2.0.0)
- Amazon.Lambda.KinesisFirehoseEvents (>= 2.1.0)
- Amazon.Lambda.LexEvents (>= 3.0.0)
- Amazon.Lambda.S3Events (>= 2.0.1)
- Amazon.Lambda.SNSEvents (>= 2.0.0)
- Amazon.Lambda.SQSEvents (>= 2.0.0)
- AWSSDK.CloudWatch (>= 3.7.2.10)
- AWSSDK.CloudWatchEvents (>= 3.7.3.21)
- AWSSDK.CloudWatchLogs (>= 3.7.1.29)
- AWSSDK.CognitoIdentityProvider (>= 3.7.1.26)
- AWSSDK.Core (>= 3.7.2.6)
- AWSSDK.Lambda (>= 3.7.3.3)
- AWSSDK.S3 (>= 3.7.1.26)
- AWSSDK.SimpleNotificationService (>= 3.7.2.25)
- AWSSDK.SQS (>= 3.7.0.55)
- Newtonsoft.Json (>= 13.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.51 | 4,999 | 9/9/2024 |
1.0.50 | 100 | 9/8/2024 |
1.0.49 | 209 | 9/3/2024 |
1.0.48 | 167 | 9/1/2024 |
1.0.47 | 8,067 | 6/4/2023 |
1.0.46 | 177 | 5/15/2023 |
1.0.45 | 13,755 | 1/18/2023 |
1.0.44 | 288 | 1/18/2023 |
1.0.43 | 372 | 12/15/2022 |
1.0.42 | 292 | 12/14/2022 |
1.0.41 | 284 | 12/13/2022 |
1.0.40 | 5,891 | 12/13/2022 |
1.0.39 | 304 | 12/8/2022 |
1.0.38 | 479 | 10/2/2022 |
1.0.37 | 378 | 10/2/2022 |
1.0.36 | 541 | 1/4/2022 |
1.0.35 | 305 | 12/22/2021 |
1.0.34 | 286 | 12/16/2021 |
1.0.33 | 300 | 12/16/2021 |
1.0.32 | 271 | 12/16/2021 |
1.0.31 | 406 | 12/14/2021 |
1.0.30 | 267 | 12/14/2021 |
1.0.29 | 289 | 12/13/2021 |
1.0.28 | 283 | 12/12/2021 |
1.0.27 | 291 | 12/1/2021 |
1.0.26 | 288 | 11/30/2021 |
1.0.25 | 293 | 11/30/2021 |
1.0.24 | 273 | 11/29/2021 |
1.0.23 | 284 | 11/29/2021 |
1.0.22 | 1,224 | 11/18/2021 |
1.0.21 | 295 | 11/18/2021 |
1.0.20 | 475 | 11/3/2021 |
1.0.19 | 334 | 11/3/2021 |
1.0.18 | 309 | 11/1/2021 |
1.0.17 | 402 | 10/31/2021 |
1.0.16 | 373 | 10/27/2021 |
1.0.15 | 312 | 10/27/2021 |
1.0.14 | 327 | 10/27/2021 |
1.0.13 | 340 | 10/25/2021 |
1.0.12 | 308 | 10/14/2021 |
1.0.11 | 312 | 10/13/2021 |
1.0.10 | 452 | 9/29/2021 |
1.0.2.2 | 392 | 9/14/2021 |
1.0.2.1 | 562 | 8/24/2021 |
1.0.2 | 303 | 8/24/2021 |
1.0.1.6 | 3,495 | 8/24/2021 |
1.0.1.5 | 310 | 8/24/2021 |
1.0.1.4 | 328 | 8/24/2021 |
1.0.1.3 | 320 | 8/24/2021 |
1.0.1.2 | 397 | 8/23/2021 |
1.0.1.1 | 334 | 8/23/2021 |
1.0.1 | 335 | 8/19/2021 |