Everything that's related to the AhaDNS server statistics collection can be found in this repository.
Everywhere you read Our and We, it refers to AhaDNS.
The solution in this repository is created for AhaDNS. It was created to enable AhaDNS to show request statistics on the website and to post daily updates on their social media accounts.
- ASP.NET Core
- Azure Functions
- Azure Table Storage
- Programming language C#
This solution have been written on late evenings by Fredrik and you should not look here to find any best practices on how to do .NET development. Fredrik can do better but have not had enough time to spend here so some shortcuts have probably been taken. Despite this, we (AhaDNS) want to have this project open-source so the public can see exactly what statistics AhaDNS do collect and how we (AhaDNS) collect it.
You're very much welcome to come with improvements!
Following is an overview of all projects in this repository and their function.
Web API to be able to retrieve statistics from unbound-control running on each DNS server. This project is installed on all AhaDNS DNS servers & all DNS server statistics are collected through this API.
An Azure Function project responsible for retrieving & storing statistics from all DNS servers running the Aha.Dns.Statistics.ServerApi project.
The project contains three main functions:
- Queries each DNS server for statistics.
- Stores the retrieved server statistics in a Azure Table Storage account.
- Summarize statistics over the last 24 hours and sends the summarized information to the wordpress website running at ahadns.com.
- Summarize statistics over the last 30 days and sends the summarized information to the wordpress website running at ahadns.com.
- A simple GET endpoint to retrieve the summarized statistics for a server over a given TimeSpan. Primarely used by our notifcation project Aha.Dns.Notifications to post daily updates in our social media accounts.
An ASP.NET Core web app that shows DNS query statistics for the last 24h. Can be seen live at statistics.ahadns.com. Gets all information from the Azure Table Storage used to store statistics.
- In
Aha.Dns.Statistics.CloudFunctions
, renameexample.settings.json
tolocal.settings.json
and configure all values as you've setup your environment. - In
Aha.Dns.Statistics.ServerApi & WebUI
you can override the default appsettings.json by creatingappsettings.Development.json
orappsettings.Production.json
depending on your environment.