Thetype exposes the following members.
Optionally configures a callback that can return an additional metrics collector for the service.
Enables Prometheus and controls how metrics are published.
Specifies the URL path for the local HTTP listener that exposes metrics for scraping by Prometheus.
Specifies the TCP port for the local HTTP listener that exposes metrics for scraping by Prometheus.
Optionally specifies additional labels to be identify the source for Push mode.
Specifies the target Prometheus Pushgateway for Push mode.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Serves as the default hash function.(Inherited from Object.)
Gets the Type of the current instance.(Inherited from Object.)
Creates a shallow copy of the current Object.(Inherited from Object.)
Returns a string that represents the current object.(Inherited from Object.)
Validates the options.
These options allow developers to customize some service behaviors. This is is exposed as the MetricsOptions property and is initialized to reasonable default values. Developers may modify these options as desired before calling RunAsync(Boolean) to start their service.
Prometheus metrics capturing is disabled by default. You can change this by setting Mode to Scrape, ScrapeIgnoreErrors, or Push. The two scrape modes expect that Prometheus will be perodically reading metrics from the service via the HTTP endpoint specified by Port and Path.
|The ScrapeIgnoreErrors mode is somewhat specialized and is intended for testing environments and is not recommended for production.|
Built-in Prometheus scraping support is limited to HTTP and not HTTPS and no authentication is enforced. Pushgateway support can use HTTPS as well as HTTP, but we don't support authentication.
For more complex scenarios, just leave Mode==Disabled and configure prometheus-net yourself before calling RunAsync(Boolean). We're trying to address 80% scenarios to reduce a bit of service related boilerplate code but prometheus-net is quite easy to configure.
|For ASPNET applications, we recommend that you leave metrics collection disabled here and configure middleware to handle the metrics; this will automatically much more detailed web related metrics. You can use the standard prometheus-net middleware builder extension.|