Integrating Prometheus and Grafana to your DotNet Core WebAPI

Suryaprakash
3 min readFeb 15, 2023

--

grafana in depth analystics

When I have the need of API Monitoring for how many API calls are getting internal server error or how many calls taking long time. I came accross the below 3 Monitoring tools. Please read the below comparision points.

AppDynamics, Dynatrace, and Grafana are all tools that offer monitoring and visualization capabilities, but they differ in their approach and feature set. Here’s a comparative analysis of these tools based on some common parameters:

  1. Data Sources: All three tools support a wide range of data sources, including databases, APIs, log files, and metrics from various systems and applications.
  2. Ease of Use: Grafana is known for its user-friendly interface and easy-to-use dashboard editor, while AppDynamics and Dynatrace have a steeper learning curve due to their more complex feature set.
  3. Monitoring Capabilities: AppDynamics and Dynatrace offer more comprehensive monitoring capabilities, including end-to-end transaction tracing, code-level visibility, and automatic anomaly detection. Grafana is more focused on visualization and requires other tools to provide monitoring data.
  4. Alerting: All three tools provide alerting capabilities, but AppDynamics and Dynatrace offer more advanced alerting options, including anomaly detection, baselining, and custom threshold settings.
  5. Cost: AppDynamics and Dynatrace are more expensive than Grafana, as they offer more advanced features and require more resources to run.

Overall, the choice between these tools will depend on your specific monitoring and visualization needs. If you need a comprehensive monitoring solution with advanced features and automatic anomaly detection, AppDynamics or Dynatrace may be a better fit. If you need a more lightweight and flexible tool for visualization and monitoring, Grafana may be the way to go. And Grafana is the only free tool in these and easy to deploy also.

Grafana Installation :

grafana download page

I downloaded Grafana Standalone Windows binaries, other ways to go are in the image. Once downloaded it will take some time to extract the zip file. Once Extracted, we can find the bin folder and grafana-server.exe will be inside. Simply executing it, will start to run in localhost:3000 as default. there username and password will admin as default and can be changeable in future.

Now, when you search for localhost:3000. Grafana is up and runnning.

grafana home page

Here the hardest part, grafana is only the visualization tool. We will need help from prometheus for monitoring, logging the metrics of the server. There are lot of other data sources but the better way is to go with prometheus since lot of documentation is available to integrate with dotnet core webapi and it is simple too.

Prometheus Installation :

Prometheus download page

Click the required zip file for your OS and UnZip it. You can find the prometheus-server.exe inside bin folder. Run the Server and it will start running in localhost port 9090.

prometheus screenshot homepage
Prometheus ScreenShot

--

--

Suryaprakash
Suryaprakash

Written by Suryaprakash

Angular Architect @PlateauCorp. Expert in Angular and .Net Core.

No responses yet