Asos.OpenTelemetry.Exporter.EventHubs
0.1.2
Prefix Reserved
See the version list below for details.
dotnet add package Asos.OpenTelemetry.Exporter.EventHubs --version 0.1.2
NuGet\Install-Package Asos.OpenTelemetry.Exporter.EventHubs -Version 0.1.2
<PackageReference Include="Asos.OpenTelemetry.Exporter.EventHubs" Version="0.1.2" />
paket add Asos.OpenTelemetry.Exporter.EventHubs --version 0.1.2
#r "nuget: Asos.OpenTelemetry.Exporter.EventHubs, 0.1.2"
// Install Asos.OpenTelemetry.Exporter.EventHubs as a Cake Addin #addin nuget:?package=Asos.OpenTelemetry.Exporter.EventHubs&version=0.1.2 // Install Asos.OpenTelemetry.Exporter.EventHubs as a Cake Tool #tool nuget:?package=Asos.OpenTelemetry.Exporter.EventHubs&version=0.1.2
Open Telemetry Export for Event Hubs
A library for sending OTLP data to an Azure Event Hubs endpoint.
What's it for?
This library is specifically to simplify in process scenarios where agents or other collector patterns aren't an option and you'd like the process being instrumented to be responsible for transmitting data to the target
How does it work?
This is a bit of syntantic sugar to help with bootstrapping the Event Hubs endpoint and setting up authentication. The exporter
option we expose here AddOtlpEventHubExporter
builds directly onto AddOtlpExporter
and sets up the necessary configuration.
In particular, that's setting the protocol to HttpProtobuf
and the HttpClientFactory
to take an instance that handles tokens and
token refreshes.
The library will support either SAS key authentication or Managed Identity, and sets up the HttpClient
to transmit the appropriate
authorization header.
Example configurations
Create an EventHubOptions
object and choose from either SAS key authentication or managed identity. When configuring your services, you
now have an extension named AddOtlpEventHubExporter
that you can pass the options to
var eventHubOptions = new EventHubOptions
{
AuthenticationMode = AuthenticationMode.SasKey,
KeyName = "the-name-of-the-access-key"
AccessKey = "the-event-hub-access-key",
EventHubFqdn = "fully-qualified-target-eventhub-uri"
};
OR
var eventHubOptions = new EventHubOptions
{
AuthenticationMode = AuthenticationMode.ManagedIdentity,
EventHubFqdn = "fully-qualified-target-eventhub-uri"
};
services.AddOpenTelemetryMetrics(builder => builder
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("DemoService"))
.AddAspNetCoreInstrumentation()
.AddMeter("MeterName")
.AddOtlpEventHubExporter(eventHubOptions));
Permissions
When running as a SAS key, the permissions are available from the access key you've used. However, when running in ManagedIdentity, you'll need to grant the Azure Event Hubs Data Sender role to the identity you want to access the Event Hub endpoint.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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. |
-
net6.0
- Azure.Identity (>= 1.7.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.