Skip to content

TCMPK/syringe

Repository files navigation

Issues Go Version


Logo

Syringe

The missing dns-preheating daemon!
Explore the docs »

Screenshots · Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Usage
  3. Building
  4. Monitoring & Metrics
  5. Screenshots
  6. Roadmap
  7. Contributing

About The Project

During my quest to improve customer satisfaction, I asked myself how I may reduce the impact on customers dns response times during frequent component replacements (the component is a dns-resolver in this case if you mind asking).

Background: In a setup where services are announced via bgp, any component is suspect to hot replacement. DNS-resolver heavily rely on their query cache to answer valid or bogus queries as fast as possible. When spinning up a new server, it may experience full production traffic without a filled cache. This may lead to clogged query upstreams or even a brief period of blacklisting if a common upstream resolver (e.g. tiering) is used. To address this issue, this project was started.

Side note: This is also a "java programmer"'s first take on a go application which is perfect for this use-case.

(back to top)

Usage

NOTE: Please download/build a specific release first See Releases for prebuilt artifacts

Usage is as easy as:

# linux/mac
./syringe PARAMS
# windows
.\syringe.exe PARAMS

Command-Line Parameters (PARAMS)

Flag Value Default Description
-help (none) Print a help message showing all available flags
-config Valid Path syringe.yml Use the specified config instead of the default

Configuration (syringe.yml)

For informations regarding the configuration file, please refer to the Documentation

(back to top)

Getting started is easy as there are many methods to start right away!

  • First clone the repository
    git clone https://github.com/TCMPK syringe
  • cd into the cloned directory
    cd syringe

docker-compose

Preprequisites

  • docker
  • docker-compose

Build & Run the application

  • Build the image and start an attached compose-stack
    docker-compose up # will do a "docker-compose build" if the image does not exist
  • Open http://localhost:8000/docs/index.html which which should present you with the swagger-api documentation. Now you can get your hands on

Docker

Preprequisites

  • docker

Build & Run the application

  • Build the image
    docker build -t syringe . # build the image named "syringe" in the current directory .
  • Start the container and attach
    # The api is listining on 0.0.0.0:8000 so we need to map the port
    docker run -it -p 8000:8000 syringe # start the container and attach stdout/stdin 
  • Open http://localhost:8000/docs/index.html which which should present you with the swagger-api documentation. Now you can get your hands on

Bare Metal (Linux, Mac, Windows)

Preprequisites

  • golang
  • gcc

Build & Run the application

  • Download all modules
    go mod download
  • Build
    # build linux/mac
    go build -o syringe
    # windows 
    go build -o syringe.exe
  • Run
    # linux/mac
    ./syringe
    # windows
    .\syringe.exe
  • Open http://localhost:8000/docs/index.html which which should present you with the swagger-api documentation. Now you can get your hands on

(back to top)

Metrics are exposed as Prometheus metrics are available via localhost:8000/metrics. Visualization is also provided as Grafana dashboard in the grafana/dashboard.json folder.

Setup

  • Install Prometheus or use a Docker container
  • Install Grafana or use a Docker container
  • Setup a Prometheus scrape job and adjust target as for your deployment
    scrape_configs:
      - job_name: 'syringe scrape'
        scrape_interval: 5s
        static_configs:
          - targets: 
            - 'localhost:8000'
  • Add the Prometheus data source to Grafana
  • Import the Grafana dashboard from the grafana/dashboard.json file
  • Select the correct Data Source (uses default by default) in the syringe dashboard if multiple data sources are present

(back to top)

Screenshots

Grafana Dashboard grafana/dashboard.json

Swagger Documentation http://localhost:8000/docs/index.html

(back to top)

Roadmap

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

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  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 Apache license 2.0.

(back to top)

Contact

Peter Klein - [email protected]

Project Link: https://github.com/TCMPK/syringe

(back to top)

About

syringe - the missing dns-preheating daemon

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •