EventBus.Sqs.Tracing 1.0.3

There is a newer version of this package available.
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
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EventBus.Sqs.Tracing" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EventBus.Sqs.Tracing --version 1.0.3
#r "nuget: EventBus.Sqs.Tracing, 1.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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

Build status NuGet License

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;
});

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:

Link

Tracing

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.0.1 468 5/26/2020
2.0.0 389 4/22/2020
1.0.4 452 1/15/2020
1.0.3 416 1/13/2020
1.0.2 442 1/13/2020
1.0.1 502 1/6/2020
1.0.0 520 1/5/2020