From cc269fd984a5f0806c83d3d804ff0b732fb3da80 Mon Sep 17 00:00:00 2001 From: glucaci Date: Mon, 8 Mar 2021 09:31:48 +0100 Subject: [PATCH] Add readme --- README.md | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 38199b4..4f73e0f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,50 @@ -Work in Progress +Elastic APM extensions for multiple .NET libraries. +## Features -## Getting Started +- Messaging + - [X] [MassTransit](#masstrasit) + - [ ] Azure Service Bus -## Features +- GraphQL + - [X] [HotChocolate](#hotchocolate) + +- Storage + - [ ] Azure Blob Storage + +### MassTransit +```csharp +public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }) + .UseElasticApm( + // Add additional diagnostic subscribers e.g. AspNetCore, Http, etc + new MassTransitDiagnosticsSubscriber()); +``` + +The following events from the [MassTransit DiagnosticSource](https://masstransit-project.com/advanced/monitoring/diagnostic-source.html) are instrumented: +- `Transport.Send` +- `Transport.Receive` + +### HotChocolate +HotChocolate by default is not emitting diagnostic events, but has the infrastructure to instrument each request. +```csharp +public class Startup +{ + public void ConfigureServices(IServiceCollection services) + { + // Add your services + // Add HotChocolate GraphQL Server + services + .AddGraphQLServer() + .AddQueryType() + .AddObservability(); // Register instrumentation for Elastic APM + } +} +``` ## Community This project has adopted the code of conduct defined by the [Contributor Covenant](https://contributor-covenant.org/)