Skip to content

microsoft/AmbariBasedHadoopExporter

Repository files navigation

Introduction

Apache Ambari is an open-source management tool that allows you to administer your Hadoop cluster easly. Ambari uses AMS (Ambari Metrics System) to monitor an collect logs from related Hadoop installtions in your cluster, exposing them to the user in each component dashboard. In addition, you may want to export those metrics to a cenralized tool you are using. Grafana has a built in support for that, which is great.
However, you may want to export AMS's collected metrics to a different source like Prometheus. This repo attepts to try and solve this issue, implementing a Prometheus exporter for Hadoop based on Ambari API.

Note - there are open source Prometheus exporters for some Hadoop components like YARN and HDFS, but, Ambari gives you a single point of access to multiple collected metrics for services, components and configuration. Thus our effort building an exporter based on its API.

Tested environment

We're running on Azure environment, using Azure HDInsight cluster 3.6 running HDP 2.6.
The exporter was deployed on our Kubernetes cluster running init-container that handles all secrets acquisition from an Azure Key Vault and injection to our containers.

Download from DockerHub

You can download an image from this DockerHub.

Build with Docker

  1. Clone the project and go to its root folder.
  2. Run docker build . -t ambari-exporter, this will create a docker image on your local machine, run docker images ambari-exporter to validate that the image exists.

Deploying to Kubernetes

Every service requires settings file to run, an example of full settings file can be found here. But, since we're using Kubernetes as our orchestrator, we can leverage helm to inject those values during deployment as environment variables.

Prerequisites

Install init-container in your cluster for Azure Key Vault integration. This is used to extract secrets in a secure way.

Deployment example

View an example deployment helm chart here.

Dependencies

All of the exporters are based on Ambari's API.

Implementation dependencies:

  1. Prometheus-net - used to expose the API endpoint for Prometheus.
  2. Serilog - for formatting log messages.
  3. Newtonsoft - for Json parsing.
  4. FluentAssertions, Moq 4, xUnit - for testing.
  5. StyleCop - for code formatting.

Support

For any issue, request, question please feel to create an issue, we'll be trying giving you the best support as possible.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Exporter based on Hadoop clusters that use Ambari as their administrative tool, leveraging Ambari API to export cluster's metrics.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages