Reporters

App Metrics reporters allows your defined metrics to be flushed for reporting and visualization. The following is a list of the reporters currently available.

    Influx Data

    InfluxDB The App.Metrics.Reporting.InfluxDB nuget package reports metrics to InfluxDB using the App.Metrics.Formatters.InfluxDB nuget package to format metrics by default using the Line Protocol. Getting started To use the InfluxDB reporter, first install the nuget package: nuget install App.Metrics.Reporting.InfluxDB Then enable the reporter using Report.ToInfluxDb(...): var metrics = new MetricsBuilder() .Report.ToInfluxDb("http://127.0.0.1:8086", "metricsdatabase") .Build(); App Metrics at the moment leaves report scheduling up the the user unless using App.

    Prometheus

    Basics Prometheus promotes a Pull based approach rather than Push, therefore App Metrics does not include a reporter to push metrics, but rather supports formatting metric data in Prometheus formats using the App.Metrics.Formatters.Prometheus nuget package. App.Metrics.Formatters.Prometheus supports both Prometheus’s plain text and protobuf formats. To use the Prometheus formatter, first install the nuget package: nuget install App.Metrics.Formatters.Prometheus Then enable Prometheus formatting using the MetricsBuilder: Plain text To configure Prometheus plain-text formatting:

    Elasticsearch

    The App.Metrics.Reporting.Elasticsearch nuget package reports metrics to ElasticSearch using the App.Metrics.Formatters.Elasticsearch nuget package to format metrics as Elasticsearch documents. Getting started To use the Elasticsearch reporter, first install the nuget package: nuget install App.Metrics.Reporting.Elasticsearch Then enable the reporter using Report.ToElasticsearch(...): var metrics = new MetricsBuilder() .Report.ToElasticsearch("http://127.0.0.1:9200", "metricsindex") .Build(); App Metrics at the moment leaves report scheduling up the the user unless using App.Metrics.AspNetCore.Reporting. To run all configured reports use the ReportRunner on IMetricsRoot:

    Graphite

    The Graphite Reporter is not yet available for App Metrics 2.0.

    Http

    The App.Metrics.Reporting.Http nuget package reports metrics to a custom HTTP endpoint. The default output is JSON using App.Metrics.Formatters.JSON which can be substituted with any other App Metrics Formatter. Getting started To use the HTTP reporter, first install the nuget package: nuget install App.Metrics.Reporting.HTTP Then enable the reporter using Report.OverHttp(url): var metrics = new MetricsBuilder() .Report.OverHttp("http://localhost/metrics") .Build(); App Metrics at the moment leaves report scheduling up the the user unless using App.

    Console

    The App.Metrics.Reporting.Console nuget package writes metrics to the Windows Console via standard output. The default output is plain text using App.Metrics.Formatters.Ascii which can be substituted with any other App Metrics Formatter. Getting started To use the console reporter, first install the nuget package: nuget install App.Metrics.Reporting.Console Then enable the reporter using Report.ToConsole(): var metrics = new MetricsBuilder() .Report.ToConsole() .Build(); App Metrics at the moment leaves report scheduling up the the user unless using App.

    Text File

    The App.Metrics.Reporting.TextFile nuget package writes metrics to a text file. The default output is plain text using App.Metrics.Formatters.Ascii which can be substituted with any other App Metrics Formatter. Getting started To use the text file reporter, first install the nuget package: nuget install App.Metrics.Reporting.TextFile Then enable the reporter using Report.ToTextFile(): var metrics = new MetricsBuilder() .Report.ToTextFile() .Build(); If not output file name is specified, the default path is the application execution path and file name metrics.