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
<PackageReference Include="NBomber.Sinks.Prometheus" Version="1.0.0" />
paket add NBomber.Sinks.Prometheus --version 1.0.0
#r "nuget: NBomber.Sinks.Prometheus, 1.0.0"
// 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:
Set up your load test scenario using NBomber.
Configure NBomber to use the Prometheus sink. Refer to the NBomber documentation for information on how to configure sinks.
Configure Prometheus job to scrape metrics from the NBomber Prometheus sink.
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 | 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net6.0
- NBomber.Contracts (>= 5.1.0)
- OpenTelemetry.Exporter.Prometheus.HttpListener (>= 1.6.0-alpha.1)
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 | 274 | 7/14/2023 |