EventBus.Sqs.Tracing
1.0.3
See the version list below for details.
dotnet add package EventBus.Sqs.Tracing --version 1.0.3
NuGet\Install-Package EventBus.Sqs.Tracing -Version 1.0.3
<PackageReference Include="EventBus.Sqs.Tracing" Version="1.0.3" />
paket add EventBus.Sqs.Tracing --version 1.0.3
#r "nuget: EventBus.Sqs.Tracing, 1.0.3"
// Install EventBus.Sqs.Tracing as a Cake Addin
#addin nuget:?package=EventBus.Sqs.Tracing&version=1.0.3
// Install EventBus.Sqs.Tracing as a Cake Tool
#tool nuget:?package=EventBus.Sqs.Tracing&version=1.0.3
opentracing-sqs-csharp
A simple C# library for instrumentation of SQS messages with OpenTracing.
Dependencies
- NET Core 3.1
- AWSSDK.SQS 3.3.102.54
- OpenTracing
Installation
Install the NuGet package:
> dotnet add package EventBus.Sqs
> dotnet add package EventBus.Sqs.Tracing
Getting started
Before, in your application's Startup.cs file, configure OpenTracing first.
using OpenTracing.Util;
...
services.AddSingleton(serviceProvider =>
{
var loggerFactory = new LoggerFactory();
var config = Jaeger.Configuration.FromEnv(loggerFactory);
var tracer = config.GetTracer();
if (!GlobalTracer.IsRegistered())
GlobalTracer.Register(tracer);
return tracer;
});
Check this link for more information about Jaeger configuration via environment.
https://github.com/jaegertracing/jaeger-client-csharp
Next, configure EventBus.Sqs with tracing:
using EventBus.Sqs.Configuration;
using EventBus.Sqs.Tracing.Configuration;
...
services.AddEventBusSQS(Configuration)
.AddOpenTracing();
Configure health checks for SQS
services.AddHealthChecks()
.AddSqsCheck<HereAddYourIntegrationEvent>();
Finally, We can using in your application's Controller.cs file, Check below this example:
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private readonly IEventBus eventBus;
public WeatherForecastController(IEventBus eventBus)
{
this.eventBus = eventBus;
}
[HttpPost]
public async Task<ActionResult> Create()
{
var rng = new Random();
//Create sample Integration Event
var weatherInEvent = new WeatherInEvent(Guid.NewGuid().ToString(), "Freezing");
await eventBus.Enqueue(weatherInEvent);
return Accepted();
}
}
Don't forget, Creating your Integration event:
public class WeatherInEvent : IntegrationEvent
{
public string WeatherEventId { get; set; }
public string Summary { get; set; }
public WeatherInEvent(string id, string summary) : base(id, DateTime.UtcNow)
{
WeatherEventId = id;
Summary = summary;
}
}
More examples:
Contact
These email addresses serve as the main contact addresses for this project.
Bug reports and feature requests are more likely to be addressed if posted as issues here on GitHub.
License
This project is licensed under the terms of the MIT license, see also the full LICENSE.
MIT License
Copyright (c) 2020 Joel Junior
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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 | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- EventBus.Sqs (>= 1.0.3)
- OpenTracing (>= 0.12.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.