Code Monkey home page Code Monkey logo

sky-meter's Introduction

sky-meter

CodeQL Dependency Review

Sky-meter is a synthetic endpoint checker. You can deploy this on your infra and run checks from your infa and set alerts. Here we are using the go httptrace library.
Currenly we have addded Database support. The endpoints and http output are now being saved in Database. We also have a sentry integration to catch the runtime errors. Development is in progress

Alerting

We have integrated SMTP and Opsgenie, more integrations are in pipeline Currently the project is under developmet. You may have to experience some glitches at this moment.

Tested Environments

GO version: 1.18
Postgres : 15.0

Tested OS

  • Ubuntu 22.10
  • alpine(docker)
  • Macos

We are highly recommending to run th app as docker container. See Docker Hub Image https://hub.docker.com/r/soorajsky/sky-meter

Environment variables

Variable Type Example
DnsServer string 8.8.8.8
Port string 8000
EmailPass string youremailpass
EmailFrom string [email protected]
EmailPort string 583
EmailServer string smtp.gmail.com
OpsgenieSecret string examplesecret
SentryDsn string exapledsnvalue
Mode string prod
DbUrl string host=localhost user=postgres password=postgres dbname=postgres port=5433 sslmode=disable

Add URLs to check

To add a URL to minitoring is pertty simple. Create settings.yml to add your endpoints to monitor. See an example of settings.yml below

opegenie:
  enabled: false
email:
  enabled: true
groups:
- name: prod
  emails:
     - [email protected]
     - [email protected]
- name: dev
  emails:
     - [email protected]
     - [email protected]
domains:
- name: https://skywalks.in
  enabled: true
  timeout: 10
  skip_ssl: false
  frequency: 10
  group: dev
- name: https://sky-meter.skywalks.in
  enabled: true
  timeout: 10
  skip_ssl: false
  frequency: 60
  group: dev
- name: https://github.com
  enabled: true
  timeout: 10
  skip_ssl: false
  frequency: 60
  group: prod

- name: https://githcccubs.com
  enabled: true
  timeout: 10
  skip_ssl: false
  frequency: 60
  group: prod

timeout : Timeout of request in Millisecond (int)
skip_ssl : set flase if you want to skip the ssl verification (bool)
frequency : frequency of health check in secont (int)
group : Group settings

Run the Code

Clone the code

$ git clone https://github.com/sooraj-sky/sky-meter.git
$ cd sky-meter

Run the postgres docker container (skip this step if you already have a database)

$ docker-compose up -d

Export ENV variables (Sentry will work only in dev mode)
If Email is disbled on settings.yml the following variables are not needed.

  1. EmailPass
  2. EmailFrom
  3. EmailPort
  4. EmailServer

SentryDsn is only needed when Mode=dev

$ export DnsServer="8.8.8.8" #requied  
$ export DbUrl="host=localhost user=postgres password=postgres dbname=postgres port=5433 sslmode=disable"  #requied          
$ export EmailPass="your-pass-here" #requied when Email is Enabled  
$ export EmailFrom="[email protected]" #requied when Email is Enabled     
$ export EmailPort="587" #requied when Email is Enabled     
$ export EmailServer="smtp.server-address-here.com" #requied when Email is Enabled   
$ export OpsgenieSecret="your-opsgenie-key-here" #requied when Opsgenie is Enabled on settings.yml
$ export Mode="dev"  
$ export SentryDsn="your-DSn-key-here" #requied when Mode="dev"           

Run the project

$ go run cmd/main.go  

CI

we are using concourse CI for Main Branch

For release branch we have Github Actions

sky-meter's People

Contributors

dependabot[bot] avatar linuxpuppy avatar sooraj-sky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sky-meter's Issues

No initialisation check

Need to add a initial check. Ensure the following things are available before starting the health check.
Db connection.
Env variables.
Config files.

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.