Confluent.Kafka.Extensions.OpenTelemetry
0.4.0
dotnet add package Confluent.Kafka.Extensions.OpenTelemetry --version 0.4.0
NuGet\Install-Package Confluent.Kafka.Extensions.OpenTelemetry -Version 0.4.0
<PackageReference Include="Confluent.Kafka.Extensions.OpenTelemetry" Version="0.4.0" />
paket add Confluent.Kafka.Extensions.OpenTelemetry --version 0.4.0
#r "nuget: Confluent.Kafka.Extensions.OpenTelemetry, 0.4.0"
// Install Confluent.Kafka.Extensions.OpenTelemetry as a Cake Addin #addin nuget:?package=Confluent.Kafka.Extensions.OpenTelemetry&version=0.4.0 // Install Confluent.Kafka.Extensions.OpenTelemetry as a Cake Tool #tool nuget:?package=Confluent.Kafka.Extensions.OpenTelemetry&version=0.4.0
Confluent.Kafka.Extensions.OpenTelemetry
The Confluent.Kafka.Extensions.OpenTelemetry
package enables collection of instrumentation data of the Confluent.Kafka
library.
The actual instrumentation of the Confluent.Kafka
library should be configured using
Confluent.Kafka.Extensions.Diagnostics.
Installation
Install-Package Confluent.Kafka.Extensions.OpenTelemetry
Usage
Confluent.Kafka configuration
As Confluent.Kafka
does not expose any instrumentation data, additional, configuration is required.
Full documentation is available at Confluent.Kafka.Extensions.Diagnostics docs.
There is also an example on how to use the package in real world application.
Producer
using Confluent.Kafka;
using Confluent.Kafka.Extensions.Diagnostics;
using var producer =
new ProducerBuilder<Null, string>(new ProducerConfig(new ClientConfig { BootstrapServers = "localhost:9092" }))
.SetKeySerializer(Serializers.Null)
.SetValueSerializer(Serializers.Utf8)
.BuildWithInstrumentation();
await producer.ProduceAsync("topic", new Message<Null, string> { Value = "Hello World!" });
Consumer
using Confluent.Kafka;
using Confluent.Kafka.Extensions.Diagnostics;
using var consumer = new ConsumerBuilder<Ignore, string>(
new ConsumerConfig(new ClientConfig { BootstrapServers = "localhost:9092" })
{
GroupId = "group", AutoOffsetReset = AutoOffsetReset.Earliest
})
.SetValueDeserializer(Deserializers.Utf8)
.Build();
consumer.Subscribe("topic");
consumer.ConsumeWithInstrumentation((result) =>
{
Console.WriteLine(result.Message.Value);
});
OpenTelemetry configuration
using Confluent.Kafka.Extensions.OpenTelemetry;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
builder.Services.AddOpenTelemetry().WithTracing(traceBuilder =>
{
traceBuilder
.AddInMemoryExporter()
.AddHttpClientInstrumentation()
.AddAspNetCoreInstrumentation()
.AddConfluentKafkaInstrumentation(); // <-- Add Confluent.Kafka OpenTelemetry support
});
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 is compatible. 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
- Confluent.Kafka.Extensions.Diagnostics (>= 0.5.0)
- OpenTelemetry.Api (>= 1.9.0)
-
net8.0
- Confluent.Kafka.Extensions.Diagnostics (>= 0.5.0)
- OpenTelemetry.Api (>= 1.9.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Confluent.Kafka.Extensions.OpenTelemetry:
Package | Downloads |
---|---|
Reactive.Kafka.Client
Abstract and simplify integrations with confluent kafka |
|
Coflnet.Core
Package Description |
|
CodeDesignPlus.Net.Kafka
CodeDesignPlus.Net.Kafka provides a robust framework for integrating Apache Kafka with .NET Core applications. This library simplifies the process of producing and consuming Kafka messages, enabling developers to build scalable and reliable event-driven systems. |
|
CodeDesignPlus.Net.Observability
CodeDesignPlus.Net.Observability provides a comprehensive framework for monitoring and observability in .NET Core applications. This library simplifies the process of collecting, analyzing, and visualizing application metrics and logs, enabling developers to build robust and maintainable observability solutions. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.4.0 | 53,009 | 8/7/2024 |
0.3.1-alpha.1 | 47 | 8/7/2024 |
0.3.0 | 250,376 | 7/27/2023 |
0.2.0 | 42,369 | 3/14/2023 |
0.1.0 | 88,087 | 8/10/2022 |