The repo contains Prometheus extension packages to App Metrics.
Branch | AppVeyor | Travis | Coverage |
---|---|---|---|
dev | |||
master |
Package | Dev Release | Pre-Release | Release |
---|---|---|---|
App.Metrics.Formatters.Prometheus |
Grab the dashboard here
- Download and install Prometheus. Runs well on Windows using
Bash on Windows on Ubuntu
- Add a new scrape_config section to your
prometheus.yml
file
scrape_configs:
- job_name: 'appmetrics'
scrape_interval: 5s
static_configs:
- targets: ['localhost:1111'] #change this to your hostname, defaults to '/metrics'
- Download and install Grafana, then create a new Prometheus Datasource pointing the the Database just created and import App.Metrics web dashboard
- Drop in the
App.Metrics.Extensions.Mvc
andApp.Metrics.Formatters.Prometheus
nuget packages into your web application. - Add App.Metrics configuration to the
Startup.cs
of your web application, instead of the JSON serialization add Prometheus serialization. You might want to check out the Sandbox project if you get stuck - Run your app and Grafana at visit
http://localhost:3000
AppVeyor and Travis CI builds are triggered on commits and PRs to dev
and master
branches.
See the following for build arguments and running locally.
Configuration | Description | Default | Environment | Required |
---|---|---|---|---|
BuildConfiguration | The configuration to run the build, Debug or Release | Release | All | Optional |
PreReleaseSuffix | The pre-release suffix for versioning nuget package artifacts e.g. beta |
ci | All | Optional |
CoverWith | DotCover or OpenCover to calculate and report code coverage, None to skip. When not None, a coverage file and html report will be generated at ./artifacts/coverage |
OpenCover | Windows Only | Optional |
SkipCodeInspect | false to run ReSharper code inspect and report results, true to skip. When true, the code inspection html report and xml output will be generated at ./artifacts/resharper-reports |
false | Windows Only | Optional |
BuildNumber | The build number to use for pre-release versions | 0 | All | Optional |
Run build.ps1
from the repositories root directory.
.\build.ps1'
With Arguments
.\build.ps1 --ScriptArgs '-BuildConfiguration=Release -PreReleaseSuffix=beta -CoverWith=OpenCover -SkipCodeInspect=false -BuildNumber=1'
Run build.sh
from the repositories root directory. Code Coverage reports are now supported on Linux and OSX, it will be skipped running in these environments.
.\build.sh'
With Arguments
.\build.sh --ScriptArgs '-BuildConfiguration=Release -PreReleaseSuffix=beta -BuildNumber=1'
Nuget packages won't be generated on non-windows environments by default.
Unfortunately there is currently no way out-of-the-box to conditionally build & pack a project by framework. Because
App.Metrics
packages target.NET 4.5.2
as well asdotnet standard
there is a work around in the build script to forcedotnet standard
on build but no work around for packaging on non-windows environments.
See the contribution guidlines in the main repo for details.
Thanks for providing free open source licensing
This library is release under Apache 2.0 License ( see LICENSE ) Copyright (c) 2016 Allan Hardy