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

    GrafanaCloud Hosted Metrics

    GrafanaCloud Hosted Metrics The App.Metrics.Reporting.GrafanaCloudHostedMetrics nuget package reports metrics to GrafanaCloud Hosted Metrics using the App.Metrics.Formatters.GrafanaCloudHostedMetrics nuget package to format metrics. Getting started To use the GrafanaCloud Hosted Metrics reporter, first install the nuget package: nuget install App.Metrics.Reporting.GrafanaCloudHostedMetrics Then enable the reporter using Report.ToHostedMetrics(...): var metrics = new MetricsBuilder() .Report.ToHostedMetrics("base url of your hosted metrics", "your hosted metrics api key") .Build(); App Metrics at the moment leaves report scheduling up the the user unless using App.

    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 Add the using App.Metrics for access the ToElasticsearch(...) extension method using App.Metrics; 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.

    Graphite

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

    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.

    Socket

    The App.Metrics.Reporting.Socket nuget package reports metrics through a socket. The reporter has no default output formatter, so one of the available formatters must be provided. Getting started To use the Socket reporter, first install the Socket nuget package: nuget install App.Metrics.Reporting.Socket Then install output formatter package of your choice. For example, to report metrics into Telegraf the InfluxDB package is required: nuget install App.Metrics.Formatters.InfluxDB Capabilities Socket reporter is transport layer to send data via sockets.

    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 Add the using App.Metrics for access the ToConsole() extension method: using App.Metrics; Then enable the reporter using Report.ToConsole():

    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.