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.
- 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.
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
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.
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.
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.