Giter Site home page Giter Site logo

cinc_server_exporter's Introduction

Crates Contributors Forks Stargazers Issues MIT License LinkedIn


CINC-Server Exporter

A prometheus exporter for CINC Server and CINC compatible configuration management solutions.
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

While working at my current gig I found we were lacking some metrics to gain a deeper visibility in to our infrastructure. I built this exporter to fill some of those gaps.

(back to top)

Getting Started

This project assumes you have cinc-server installed with the default database settings.

Installation

  1. Switch to the database user
    sudo su - opscode-pgsql
  2. pull latest release
    wget # automated builds/releases coming soon
  3. run the service
    ./cinc_server_exporter
  4. test
    curl http://localhost:9165/metrics

(back to top)

Development Setup

Recommended prerequesites

  • nix
  • devenv.sh
  • direnv

Building and running

  1. Pull latest code

    git clone https://github.com/esoterick/cinc_server_exporter.git
  2. Enter project directory

    cd cinc_server_exporter
  3. Allow direnv and let nix to do it's thing

    devenv init
  4. Update .envrc with any configuration options, most importantly the host= string should be set to the current working directory of the repo plus .devenv/state/postgres which is the default location of where devenv stores the test postgres instance data.

    export CINC_SERVER_EXPORTER_CONN_STRING="host=$(pwd)/.devenv/state/postgres user=esoterick dbname=opscode_chef"
    export CINC_SERVER_EXPORTER_INTERVAL="15"
    
  5. Allow updated direnv

    direnv allow .
    
  6. Run test database

    devenv up
    
  7. Import Test Data

    createdb opscode_chef
    psql -U rlambert -d opscode_chef -f test/data/nodes.sql
  8. Run exporter

    cargo run
  9. Scrape

    curl http://localhost:9164/metrics

(back to top)

Usage

Configuration

There are a handful of options to configure the exporter which is done via the following environment variables.

  • CINC_SERVER_EXPORTER_CONN_STRING - Postgres connection string to the CINC database. default: host=localhost user=opscode-pgsql dbname=opscode_chef
  • CINC_SERVER_EXPORTER_INTERVAL - Interval to scrape the database in seconds. default: 15
  • CINC_SERVER_EXPORTER_LISTEN_ADDR - Listen address for the exporter. default: 0.0.0.0
  • CINC_SERVER_EXPORTER_LISTEN_PORT - Listen TCP port for the exporter. default: 9164

(back to top)

Available Metrics

Current list of available exported metrics

Exporter Level

  • cinc_server_exporter_last_updated - THe UNIX timestamp of the last cache update for the cinc_server_exporter

Server Level

  • cinc_server_node_count - The count of all the nodes stored on the cinc_server

Node Level

  • cinc_server_node_last_updated - Per node, the UNIX timestamp of the last node update

Axum

  • axum_http_requests_duration_seconds_bucket
  • axum_http_requests_duration_seconds_count
  • axum_http_requests_duration_seconds_sum
  • axum_http_requests_pending
  • axum_http_requests_total

Roadmap

  • Add changelog
  • Add test data
  • Add tests
  • Document configuration options
  • Add automated builds
  • Add release url to docs

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Robert J. Lambert III - [email protected] Project Link: https://github.com/esoterick/cinc_server_exporter

(back to top)

Acknowledgments

(back to top)

cinc_server_exporter's People

Contributors

esoterick avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.