A project to collect, analyze, and visualize DevOps metrics using Grafana and DevLake.
- Overview
- Features
- Prerequisites
- Getting Started
- Use of GitHub Actions
- Project Structure
- Contributing
- License
- References
This project integrates DevLake with Grafana to provide insightful dashboards for DevOps metrics, enabling teams to monitor and improve their software development processes. Additionally, the project includes monitoring of the Kubernetes cluster itself, providing insights into cluster health, resource usage, and performance.
- Collects data from various DevOps tools (e.g., GitHub, Jira)
- Processes and transforms data using DevLake
- Visualizes metrics and trends in Grafana dashboards
- Customizable and extensible for different workflows
- Deployable to Azure Kubernetes Service (AKS)
- Azure account with permissions to create resources (Secrets in GitHub)
- Install kubernetes provider ex. Docker Desktop
- Installed terraform
- Access to supported data sources (e.g., GitHub, Jira)
-
Clone the repository:
- Clone the repository to your local machine and navigate to the project directory:
git clone https://github.com/whiteduck-classroom/Grafana-DevLake-Metrics.git cd Grafana-DevLake-Metrics -
Navigate to the services directory:
- Since deployments are managed with GitHub Actions, navigate to the
servicesdirectory where the Terraform configuration is located:
cd services - Since deployments are managed with GitHub Actions, navigate to the
-
Initialize and apply Terraform:
- Initialize Terraform to download the required providers and apply the configuration to set up the local environment:
terraform init terraform apply
-
Access Grafana:
-
Once the deployment is complete, you can access Grafana in your browser. If you are running the deployment locally, you might need to port-forward the Grafana service to access it:
kubectl port-forward svc/grafana 3000:3000 -n grafana
-
After port-forwarding, open your browser and navigate to:
-
Default credentials:
- Username:
admin - Password:
admin
- Username:
-
This project can be deployed to Azure Kubernetes Service (AKS) for production use.
But be aware that this Project is designed to be deployed over GitHub Actions
-
Set up Azure resources:
- Create a resource group:
- replace
name-resource-groupwith the name of your
az group create --name <name-resource-group> --location westeurope
- replace
- Create an AKS cluster:
az aks create --resource-group <name-resource-group> --name devlake-aks --node-count 1 --enable-managed-identity --generate-ssh-keys
- Create a resource group:
-
Configure Kubernetes access:
- Get AKS credentials:
az aks get-credentials --resource-group <name-resource-group> --name devlake-aks
- Verify access:
kubectl get nodes
- Get AKS credentials:
-
Deploy the stack to AKS:
- Use Terraform to deploy the services:
terraform init terraform apply
- Use Terraform to deploy the services:
-
Access Grafana and DevLake-ui:
- Grafana: http://:3000
- DevLake: http://:4000
This project includes GitHub Actions for deploying and managing resources on Microsoft Azure.
- Navigate to the Actions tab in your GitHub repository.
- Select the Terraform Deploy workflow.
- Click on Run workflow.
- Configure the deployment options:
- Number of Nodes: Specify how many nodes you want to create (default: 1).
- Azure Resource Group: Enter the name of your Azure Resource Group.
- Press Run workflow to start the deployment process.
- Navigate to the Actions tab in your GitHub repository.
- Select the Terraform Destroy workflow.
- Click on Run workflow.
- Confirm the destroy action:
- Enter
destroyin the confirmation field.
- Enter
- Choose what to destroy:
- Destroy all pods:
- Leave the dropdown as default and press Run workflow.
- Destroy specific pods:
- Select the
specificoption from the dropdown. - Specify the name of the pod(s) you want to delete.
- Press Run workflow.
- Select the
- Destroy all pods:
/azure-aks/- Azure AKS Terraform config/services/- DevLake and Kube-Prometheus config
Contributions are welcome! Please open issues or pull requests for improvements.