Designing and implementing Metrics and Queries for Project Tracking in GitHub and Azure DevOps


LearnAzureDevOps-O5

Designing and implementing Metrics and Queries for Project Tracking in GitHub and Azure DevOps

'OR ### Design and Implement Metrics and Queries for Project Tracking

In modern software development, tracking metrics is essential to measure progress, identify bottlenecks, and ensure that teams are delivering value efficiently. This can be done using a combination of GitHub built-in project tracking, Azure DevOps built-in project tracking, and Azure Monitor & Application Insights. Each of these platforms provides tools and features that can be leveraged to monitor and track various aspects of a project, from code quality to application performance.

Let's explore how to design and implement metrics and queries for project tracking in each of these platforms.

1. GitHub Built-in Project Tracking

GitHub provides several built-in project tracking tools to help developers manage their tasks and workflows. Key features include GitHub Issues, GitHub Projects, GitHub Actions, and GitHub Insights. These tools can be used to track various aspects of a project, such as issue resolution, pull request activity, and workflow performance.

GitHub Project Tracking Components

  1. GitHub Issues: Track tasks, bugs, feature requests, and more. Each issue can be assigned, labeled, and tracked.

  2. GitHub Projects: Organize issues, pull requests, and notes into boards with customizable columns like "To Do", "In Progress", and "Done".

  3. GitHub Actions: Track the status of CI/CD workflows and measure build times, deployment status, and test results.

Key Metrics for Tracking in GitHub

  1. Issue Metrics: Track the number of open, closed, and in-progress issues.

  2. Pull Request Metrics: Measure the average time for pull requests to be reviewed and merged.

  3. CI/CD Metrics: Monitor build duration, deployment success/failure rates, and test coverage.

  4. Commit Activity: Measure the frequency of commits, who is committing, and code churn.

Example Query (GitHub API)

To track pull requests that have been open for more than 7 days:

You can filter this data further using custom scripts to gather specific metrics, such as the age of the pull requests.

Using GitHub Insights for Project Tracking

GitHub provides Insights for repositories, offering visualizations of contributions, pull request activity, and issue status.

You can track:

  1. Contributions over time.

  2. Commit activity.

  3. Pull request review times.

  4. Issue completion rates.

2. Azure DevOps Built-in Project Tracking

Azure DevOps offers a rich set of tools for tracking project progress through Azure Boards, which can track work items, backlogs, sprints, and task assignments. It also provides integration with Azure Pipelines for CI/CD tracking and Azure Repos for version control.

Azure DevOps Project Tracking Components

  1. Azure Boards: Track user stories, bugs, tasks, and epics. You can create customized workflows and use boards to visualize and manage the progress of work items.

  2. Azure Pipelines: Track builds, releases, and deployment pipelines. You can integrate Azure Monitor and Application Insights to track pipeline success/failure rates, build times, and deployment performance.

  3. Azure Repos: Track commit activity, branch management, pull requests, and code reviews.

  4. Azure Test Plans: Track manual and automated tests, test results, and coverage.

Key Metrics for Tracking in Azure DevOps

  1. Work Item Metrics: Monitor the progress of work items (e.g., user stories, bugs, tasks) within sprints and release cycles.

  2. Build Metrics: Track build duration, success/failure rates, and build pipelines.

  3. Release Metrics: Monitor deployment times, release success/failure rates, and rollback statistics.

  4. Test Metrics: Measure test case success rates, test execution time, and code coverage.

  5. Sprint Metrics: Track progress and burndown charts for each sprint.

Example Query (Azure DevOps REST API)

To track open work items in Azure DevOps, use the following query via the Azure DevOps REST API:

This returns a list of work items based on a Work Item Query Language (WIQL) query. You can use this to track backlog items, bugs, or specific tasks.

Using Azure DevOps Analytics for Project Tracking

Azure DevOps offers Analytics Views and dashboards where you can monitor:

  1. Work Item Progress: View burndown charts, completion rates, and backlog item details.

  2. Pipeline Success Rates: Track the success/failure of your build and release pipelines.

  3. Test Results: View test execution reports, defect counts, and test pass/fail trends.

3. Using Azure Monitor and Application Insights for Project Tracking

Azure Monitor and Application Insights are powerful tools for tracking the performance, availability, and usage of applications. By integrating these with your Azure DevOps pipelines and application deployments, you can get deeper insights into how your code performs in production.

Azure Monitor

Azure Monitor is a unified platform for monitoring infrastructure, applications, and network performance. It provides a set of built-in tools for monitoring the health and performance of your services.

Key Features:

  1. Metrics: Collects and stores metrics related to resource utilization, performance, and availability.

  2. Logs: Provides rich logging capabilities for applications, infrastructure, and custom logs.

  3. Alerts: Allows you to configure alerts based on predefined thresholds (e.g., CPU usage, error rates, deployment failures).

  4. Dashboards: Allows you to visualize and analyze your metrics and logs using customizable dashboards.

Application Insights

Application Insights is part of Azure Monitor and focuses specifically on application-level telemetry. It helps you track requests, exceptions, dependencies, performance, and usage of your application.

Key Features:

  1. Request Tracking: Track incoming requests and their response times.

  2. Exception Tracking: Automatically tracks errors and exceptions in your application.

  3. Dependency Tracking: Monitor calls to databases, external APIs, and other services.

  4. Performance Metrics: Measure application performance, including response times, throughput, and failure rates.

  5. Custom Events: Allows you to log custom events, such as specific business logic steps.

Example Queries in Application Insights (KQL)

  1. Track Slow Requests:

To track requests that take more than 2 seconds, you can use this KQL query:

  1. Track Exceptions:

To track the number of exceptions over time:

  1. Track Dependency Failures:

To check the failed dependencies (e.g., database queries, API calls):

Using Azure Monitor Dashboards for Project Tracking

You can create custom dashboards in Azure Monitor to track the overall health of your project.

Key metrics to include:

  1. Build Success/Failure: Track the success/failure of builds and deployments via Azure Pipelines.

  2. Performance Metrics: Track the latency, throughput, and errors in your application through Application Insights.

  3. Alerting and Notifications: Set up alerts for critical issues, such as failures in builds or high error rates in production.

Best Practices for Implementing Project Tracking Metrics and Queries

  1. Define Key Metrics Early:

Determine which metrics are most important for your project, such as build times, deployment frequency, test coverage, and issue resolution time.

  1. Automate Tracking:

Use Azure DevOps Pipelines or GitHub Actions to automate the collection of metrics, such as build times, test results, and deployment success/failure rates.

  1. Leverage Built-in Dashboards:

Use built-in dashboards in Azure DevOps and Azure Monitor to visualize the health and progress of your project in real-time.

  1. Set Up Alerts:

Configure alerts for key performance indicators, such as slow builds, high failure rates, or high error rates in production, so that you can address issues proactively.

  1. Use KQL for Custom Insights:

Leverage Kusto Query Language (KQL) to write custom queries in Azure Monitor or Application Insights to gain deeper insights into your project’s performance and stability.

  1. Review and Optimize Regularly:

Continuously review the data you're tracking, and optimize the queries, dashboards, and alerts as your project evolves.

Summary

Designing and implementing metrics and queries for project tracking using GitHub, Azure DevOps, and Azure Monitor (including Application Insights) provides deep visibility into various aspects of your project's lifecycle, from development and testing to deployment and production monitoring. By using the tools and techniques discussed above, you can track critical metrics such as build performance, issue resolution, and application health in real-time, ensuring that you can respond to problems quickly and optimize the development process for better outcomes.

Related Articles


Rajnish, MCT

Leave a Reply

Your email address will not be published. Required fields are marked *


SUBSCRIBE

My newsletter for exclusive content and offers. Type email and hit Enter.

No spam ever. Unsubscribe anytime.
Read the Privacy Policy.