The purpose of this article is to help you understand how to connect GitHub to Metabase. To do that, you will first be introduced to the concept of data analytics, business intelligence, and the roles they can play within your organization. A brief overview will also be provided for the two main tools you will use in this article – GitHub and Metabase.

At the end of this article, you will have a firm understanding of how to use Metabase as a business intelligence tool to monitor changes in your GitHub code repositories through the GitHub API and Hevo. You will also understand some of the benefits of using an easy to access business intelligence tool to lower the barrier of entering the gathered data insights so that non-technical staff will also be able to reap its benefits. This article assumes that the reader is familiar with the basic usage of Git and the command line.

What is Metabase?

Metabase is an open-source business intelligence (BI) and data analytics tool that allows users to easily explore and visualize data without needing to write complex SQL queries. It provides a user-friendly interface where users can create dashboards, generate reports, and share insights across their organization. Metabase connects to various databases, such as MySQL, PostgreSQL, and SQL Server, enabling teams to analyze data directly from these sources. It’s popular for its simplicity and ease of setup, making it accessible to both technical and non-technical users for data-driven decision-making.

2 Easy Methods to Connect GitHub to Metabase

There are two convenient methods to connect your data from GitHub to Metabase:

Connect GitHub to Metabase Manually
To connect GitHub to Metabase manually, you will use an experimental Metabase HTTP driver that allows the use of a RESTful API as a data source. This method requires engineering skills and expertise.

Connect GitHub to Metabase Using Hevo
You can automate your data flow using Hevo. It is a fully automated platform and requires zero engineering skills from your side. It efficiently transfers GitHub data to Metabase for free.

Visit our Website to Explore Hevo

What is GitHub?

GitHub is a cloud-based platform for version control and collaboration that allows developers to host, manage, and track changes in their code repositories. It is built on top of Git, a distributed version control system, and is widely used for both open-source and private software projects. GitHub enables multiple developers to work on a project simultaneously, provides tools for reviewing and merging code changes, and allows teams to manage project workflows, bugs, and feature requests. It also integrates with other development tools and services, making it a central hub for software development and collaboration.

What is Data Analytics?


Data analytics is the process of examining, transforming, and modeling data to uncover meaningful insights, trends, and patterns that help in decision-making. It involves using statistical techniques, algorithms, and software tools to analyze raw data and draw conclusions. Data analytics is commonly used in various industries to optimize operations, predict future outcomes, and make data-driven business decisions. Key areas within data analytics include:

  • Descriptive Analytics: Summarizes past data to understand what has happened.
  • Diagnostic Analytics: Examines data to understand why something happened.
  • Predictive Analytics: Uses historical data to forecast future trends.
  • Prescriptive Analytics: Recommends actions based on data analysis to optimize outcomes.
Integrate Github Webhook to BigQuery
Integrate Gitlab to Redshift

Benefits of Visualizing Data

Here are key benefits of visualizing data:

  1. Simplifies Complex Data: Data visualization transforms large, complex datasets into easy-to-understand visuals like charts, graphs, and dashboards, making it more accessible for non-technical users.
  2. Identifies Trends and Patterns: Visual representations help in quickly spotting trends, patterns, and outliers, enabling faster decision-making and insights.
  3. Enhances Data-Driven Decision Making: By presenting data visually, stakeholders can make informed decisions based on clear insights rather than interpreting raw data.

Connect GitHub to Metabase Manually

The first step to accomplish the aim of connecting GitHub to Metabase is to install the HTTP Driver. Since this is a community-supported solution and not an official Metabase driver, the steps required to achieve this are more.

Step 1: You will first clone the Metabase repository. It is assumed that you have Git installed. Fire up a terminal, and issue the following command:

git clone https://github.com/metabase/metabase.git

Step 2: Next, change the directory to the folder in which you cloned the Metabase Git repository.

cd /path/to/cloned_metabase_repository

Step 3: Run the following command to install prerequisites for building drivers: 

lein install-for-building-drivers

Step 4: Now, clone the HTTP Driver repository like so:

git clone https://github.com/tlrobinson/metabase-http-driver.git

Step 5: Next, change the directory to the HTTP driver repository that you just cloned and run the following commands to build the HTTP driver:

lein clean
DEBUG=1 LEIN_SNAPSHOTS_IN_RELEASE=true lein uberjar

Step 6: The last step of the set-up process is to copy the output of the build step which is a .jar file to a plugins folder that you will create within the Metabase directory and then you will restart Metabase. The commands to do so are shown below:

mkdir -p /path/to/metabase/plugins/
cp target/uberjar/http.metabase-driver.jar /path/to/metabase/plugins/
jar -jar /path/to/metabase/metabase.jar

Step 7: The setup is now complete, and you are ready to start using the HTTP driver within Metabase. The HTTP driver currently supports only REST APIs that utilize JSON. To issue a query, within Metabase, use the “native” query editor. A sample query is shown below:

{
  "url": "your_api_endpoint",
  "method": "POST",
  "headers": {
    "Authentication": "YOUR_AUTH_TOKEN"
  },
  "body": {
    "foo": "bar"
  }
}

Step 8: Let us now construct a simple query that will hit the GitHub API for a particular user and list the public repositories associated with that user. For fun, we will use Metabase as the user. The full query is shown below:

{
  "url": "https://api.github.com/users/metabase/repos",
  "method": "GET",
  "headers": {
    "Authentication": "YOUR_GITHUB_TOKEN"
  }
}

If you do not have a GitHub account or do not want to issue the query as an authenticated GitHub user, you can use the simplified query below:

{"url": "https://api.github.com/users/metabase/repos"}

With this setup, it is possible to try out other GitHub API endpoints, ask more questions from your GitHub data, and play around with the presentation styles.

Connect GitHub as a Source Using Hevo

Step 1: Configure Github Webhook as your source

Here, you will have to name your Github Source

Configure Github Source github to metadatabase

Step 2: Configure your Destination

Configure Destination

Step 3: Give a Destination Table Prefix name

Give your table an appropriate prefix name so you can easily recognize your specific table in your suitable destination.

With these few quick and easy steps, you can seamlessly connect your GitHub as a source and move your data without any issues. To start your data journey today, click the widget below!

Conclusion

You have come to the end of this article. In this article, you were introduced to two prominent tools used extensively by software development teams and organizations around the world – GitHub and Metabase.

You were also introduced to data analytics, particularly descriptive analytics, how it can be used to analyze data, and the visualization techniques adopted to present that data. Thereafter, you took a whirlwind tour of the steps involved in setting up Metabase to allow it to consume APIs as a data source. You then used GitHub API to connect GitHub data for analysis inside of Metabase. It requires a lot of steps to take in, especially the portion that dealt with connecting an HTTP driver to Metabase.

You may be wondering whether there is a more convenient way of achieving all that has been discussed above, and the answer is that there is a solution. Hevo, an integrated analytics platform that can act as a data warehouse through which you can load your GitHub data and send them to Metabase for free. them through a modern, unified interface.

FAQ on Github to Metabase

How to run Metabase with GitHub repository?

Clone the Metabase GitHub repository, install dependencies, build the application, and run it locally. Access it via http://localhost:3000.

What is Metabase built on?

Metabase is built with a Clojure backend, a JavaScript frontend using React, and supports various databases for data storage.

Is Metabase open source?

Yes, Metabase is open-source and available on GitHub under the Apache 2.0 License.

Share your experience of connecting GitHub to Metabase in the comment section below.

Ofem Eteng
Technical Content Writer, Hevo Data

Ofem Eteng is a seasoned technical content writer with over 12 years of experience. He has held pivotal roles such as System Analyst (DevOps) at Dagbs Nigeria Limited and Full-Stack Developer at Pedoquasphere International Limited. He specializes in data science, data analytics and cutting-edge technologies, making him an expert in the data industry.