Giter Club home page Giter Club logo

prometheus.aspnetcore's Introduction

Monitoring ASP.NET Core apps with Prometheus

Services:

  • app-proxy (receives the json payload)
  • app (receives the json payload from app-proxy)
  • app-ping (pings each service every 100ms)

Running the stack:

docker pull microsoft/dotnet:latest
docker build -t prom-app .

docker network create promapp-net

docker run -d --network promapp-net -p 5200:5000 --name app --restart unless-stopped prom-app
docker run -d --network promapp-net -p 5100:5000 --name app-proxy --restart unless-stopped -e PROXY_FOR='http://app:5000' prom-app
docker run -d --network promapp-net -p 5300:5000 --name app-ping --restart unless-stopped -e PING_INTERVAL="100" -e PING_TARGETS='http://app:5000,http://app-proxy:5000' prom-app

Load test:

 ab -k -l -p payload.json -T application/json -c 50 -n 10000 http://<HOST-IP>:5100/ingest/event

payload.json

{
	"Log": "{Data:'mock data'}"
}

Prometheus targets:

  - job_name: 'aspnetcore'
    scrape_interval: 10s
    static_configs:
      - targets: ['app:5000', 'app-proxy:5000', 'app-ping:5000']

Proxy metrics:

# HELP dotnet_http_requests_total HTTP Requests Total
# TYPE dotnet_http_requests_total COUNTER
dotnet_http_requests_total{path="/ingest/eventlog",method="POST",status="200"} 347000
dotnet_http_requests_total{path="/Home/Ping",method="GET",status="200"} 487393
dotnet_http_requests_total{path="/favicon.ico",method="GET",status="404"} 1
dotnet_http_requests_total{path="/",method="GET",status="200"} 2
dotnet_http_requests_total{path="/home/ping",method="GET",status="200"} 10000
dotnet_http_requests_total{path="/ingest/event",method="POST",status="200"} 226798

Ping metrics:

# HELP dotnet_ping_requests_total Ping Requests Total
# TYPE dotnet_ping_requests_total COUNTER
dotnet_ping_requests_total{target="http://app:5000",status="200"} 1467989
dotnet_ping_requests_total{target="http://app-proxy:5000",status="500"} 57
dotnet_ping_requests_total{target="http://app-proxy:5000",status="200"} 1467932

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.