Getting Started with Middleware Open Source
Tags: productivity, opensource, devops
Published: 2024-05-14 07:43:11

Middleware lets you see DORA Metrics for your teams in a few clicks.

We built [Middleware Open Source](https://dev.to/middleware/middleware-open-source-dora-metrics-for-a-smoother-engineering-flow-5hd8) to enable engineering leaders to build software delivery pipelines that provide predictability to their releases and visibility into the pipeline.

In this blog we will discuss how to build and run Middleware locally and become a 10X Engineering Leader.

## 1. Pull Away

The fastest way to get started with middleware is to install docker on your machine and pull the docker image.

If you don't have Docker, download it from here.

Pull the latest Docker Image by typing the following command in your terminal: 

docker run --name middleware \
           -p 3333:3333 \
           -v middleware_postgres_data:/var/lib/postgresql/data \
           -v middleware_keys:/app/keys \
           -d middlewareeng/middleware:latest
docker logs -f middleware

This will pull the latest Middleware docker image and start building the container.

It can take some time to build and once it’s done you can get started with started with Middleware at localhost:3333

![Middleware Open Source](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1bd63v1ti158u6i130gy.png)

## 2. Set-up and configure

Middleware syncs data from multiple sources to show you DORA metrics and other insights.

The next step is connecting your code provider. For this you need to go to the integrations page (localhost:3333/integrations) and link the github integration (more integrations coming soon!).

![Middleware Setup](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/je7q7sa4oemjrsctsda4.png)

Generate your class Github PAT from over [here] (https://github.com/settings/tokens) with the scopes mentioned on the UI.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9h3ni6xfl1zr18ov3e73.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/seww5figdeucf39xbvbu.png)

Paste your token in the input box and wait a few minutes.

Once you save your token we start syncing your data like Pull Request, Workflows, Issues etc to a local Postgres database running inside your docker container. All this happens via the flask server used for data ingestion.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5dovi6jjslloxyhzf8h.png)

Data sync happens periodically to make sure that cached data is always available to calculate the metrics. This means that your experience of using Middleware is always smooth.

## 3. Team Creation

While the data is being loaded, it's time to create a team. Add your team name and link git repositories to your team.

Your DORA metrics for the team will be linked to the data from these repositories.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9xj91dodsfqad320c1ip.png)

## 4. Keys

Visit the DORA Metrics page to view the 4 Key DORA Metrics for your team with git based data.

You will be able to see a relative score for each of those metrics provided by dora.dev

Click on see details to get deeper insights on your metrics.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jdxnwub4ub5uqwp57lh5.png)

## 5. How do we get these metrics ?

You can study in depth about the 4 keys but they depend on 3 models: Pull Request, Incidents, Deployments.

We get the PullRequest data from github or any code provider and transform it into the Database model.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/skxnk6pzq2wtb03wnlke.png)

Middleware allows showing DORA Metrics Purely based on Git Data itself.

Github Workflows or any other deployment providers can be used to to get Deployment related data. To keep things simple teams can set PR merges to be considered as deployments.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6vuoduciz9s93iebdp0c.png)

An incident is usually an event which may lead to a service outage or bug. For now we consider Revert PRs as incidents.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dc0y4fg4rr1l1sv4u02f.png)

DORA metrics can be highly beneficial in a team's growth. You can read this [article by Google](https://cloud.google.com/blog/products/devops-sre/using-the-four-keys-to-measure-your-devops-performance) to get a deeper understanding of how these metrics can be leveraged.

We are open source, feel free to [star the repo](https://github.com/middlewarehq/middleware) and open any issues related to enhancements that you would like to see.

To get more insights on your teams and a deeper visibility into DORA, try [MiddlewareCloud](https://www.demo.middlewarehq.com/), where we offer more integrations like CircleCi, Zenduty, OpsGenie etc and much more.