NBomber.Sinks.Prometheus 1.0.0

dotnet add package NBomber.Sinks.Prometheus --version 1.0.0
NuGet\Install-Package NBomber.Sinks.Prometheus -Version 1.0.0
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="NBomber.Sinks.Prometheus" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NBomber.Sinks.Prometheus --version 1.0.0
#r "nuget: NBomber.Sinks.Prometheus, 1.0.0"
#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 NBomber.Sinks.Prometheus as a Cake Addin
#addin nuget:?package=NBomber.Sinks.Prometheus&version=1.0.0

// Install NBomber.Sinks.Prometheus as a Cake Tool
#tool nuget:?package=NBomber.Sinks.Prometheus&version=1.0.0

NBomber Prometheus Sink

NBomber Prometheus Sink is a custom sink for NBomber load-testing framework. It integrates with Prometheus, a popular monitoring and alerting toolkit, allowing you to collect and visualize load testing metrics.

Features

  • Integrates NBomber with Prometheus for monitoring load test metrics.
  • Provides predefined metrics for request latency, request counts, RPS, and more.
  • Supports custom tags for fine-grained metric grouping.
  • Easy setup and configuration.

Installation

You can install the NBomber Prometheus Sink via NuGet. Run the following command in the NuGet Package Manager Console:

PM> Install-Package NBomber.Sinks.Prometheus

Usage

To use the NBomber Prometheus Sink, follow these steps:

  1. Set up your load test scenario using NBomber.

  2. Configure NBomber to use the Prometheus sink. Refer to the NBomber documentation for information on how to configure sinks.

  3. Configure Prometheus job to scrape metrics from the NBomber Prometheus sink.

  4. Run your load test.

For more details on configuring and using the NBomber Prometheus Sink, refer to the samples.

Code Samples

Here's an example of how to set up a load test scenario with the NBomber Prometheus Sink:

// Create a Prometheus Sink
var prometheusSink = new PrometheusSink();

// Configure your scenario
var scenario = Scenario.Create("MyScenario", RadclientAuthenticateUser);

// Start the load test
NBomberRunner
    .RegisterScenarios(scenario)
    .WithReportingInterval(TimeSpan.FromSeconds(10)) // Default OpenTelemetry exporter reporting interval
    .WithReportingSinks(prometheusSink)
    .Run()

For more code samples and examples, please refer to the samples directory.

How it works

NBomber.Sinks.Prometheus utilizes OpenTelemetry.Exporter.Prometheus.HttpListener to export metrics. During the execution of your load test, the sink creates an HttpListener instance that listens on the http://localhost:9464/metrics endpoint by default. Subsequently, the Prometheus job scrapes metrics by calling the endpoint.

Product 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. 
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
1.0.0 196 7/14/2023