Go-watchdog - a web application observability tool built for Go

Overview

go-watchdog

Go-watchdog is a web application observability tool built for Go, it exposes a status endpoint for application services like databases, caches, message-brokers, mails and storages.

Setting up Go-watchdog

Go-watchdog is pretty much loosely-coupled hence allowing developers the ease to customize it to their use cases. The bases schema for configuring watchdog, is the WatchdogConfig struct,

# The watchdog Struct

import(
	"github.com/salemzii/go-watchdog/caches"
	"github.com/salemzii/go-watchdog/databases"
	storages "github.com/salemzii/go-watchdog/storages"
)

type WatchdogConfig struct {
	//Path      string               `json:"path"`
	Databases []databases.Database `json:"databases"`
	Caches    []caches.Cache       `json:"caches"`
	Storages  []storages.Storage   `json:"storages"`
}
	# Initializing WatchDog
	
	import (
		app "github.com/salemzii/go-watchdog/app"
		"github.com/salemzii/go-watchdog/caches"
		"github.com/salemzii/go-watchdog/databases"
		storages "github.com/salemzii/go-watchdog/storages"
		"github.com/salemzii/go-watchdog/utils"
	)

	watchDogConfig := utils.WatchdogConfig{

		Databases: []databases.Database{

			{Type: "postgresql",
				Name:     "username",
				Addrs:    "db.elephantsql.com",
				Password: "password",
				Username: "username"},

			{Type: "mongodb",
				UriOnly: "mongodb+srv://username:[email protected]"},
		},

		Caches: []caches.Cache{
			{Type: "redis", Addrs: "", Password: ""},
		},

		Storages: []storages.Storage{
			{Type: "aws", Region: "", BUCKET: ""},
		},
	}

Since, each service (i.e databases, storages etc) requires distinct parameters to make connection to it's server, the watchdog struct fields generally represents a slice of particular service type.

Registering Watchdog

Once you've configured the services you want to watch as specified above, you can call the utils.Register() function to make your watchdog config available to the the watchdog "ServiceCheckers". Usually you can register the config by passing it's memory address to the register function: func Register(conf *WatchdogConfig) { Config = *conf }

"utils.Register(&watchDogConfig)"

Preview Desktop view

alt text

Preview Mobile View

alt text

Databases

The watchdog database struct lets you config your db's credentials;

Type: The type of database you're configuring.
Name: The name of the database you're connecting to.
Addrs: The uri to the database's server.
Username: The db's username.
Password: The db's password.
Timeout: number of seconds to wait before timeout error, Watchdog sets the default to 10secs.
UriOnly: In Cases where db's credentials are already preconfigured to a single address/URL. If this value is set, watchdog automatically makes 		connection to the db's server using the credentials specified in the uri.

``` go 
	type Database struct {
		Type     string `json:"type"`
		Name     string `json:"name"`
		Username string `json:"username"`
		Password string `json:"password"`
		Addrs    string `json:"addrs"`
		Timeout  uint   `json:"timeout"`
		UriOnly  string `json:"uri_only"` // when db credentials are already preconfigured to a single address/URL
		Uri      string `json:"uri"`     
	}```

Supported Databases: Currently go-watchdog supports just a handful of databases services, we are working endlessly to add support for more databases, you can also do well to contribute as any effort is appreciated.

```
	"SQL":   {"mysql", "sqlite", "postgresql", "oracle", "sql-server"},
	"NO-SQL": {"mongodb", "couchbase", "dynamodb", "cockroachDB"},
```
You might also like...
A simple web application written in Golang which listens on port 8080

GoWebApp It's a simple web application written in Golang which listens on port 8080 Building It can be build using the command go build -o metricsweba

A web application example to work with a customer object

Wallester Task This repository contains a web application example to work with a customer object. Build in GO version 1.17.1 Live running app example

🖖🏻 A self-hosted Quora like web application written in Go
🖖🏻 A self-hosted Quora like web application written in Go

Guora 🖖🏻 A self-hosted Quora like web application written in Go 基于 Golang 类似知乎的私有部署问答应用 包含问答、评论、点赞、管理后台等功能 Quick Start (Docker Deploy) $ docker-comp

Using golang framework (Gin) to create a web-application

News feeder Using golang framework (Gin) to create a web-application. This simpl

Go-service-gin - Simple Web api application developed in Golang and Gin

Simple Web api application developed in Golang and Gin Initial Tutorial URL http

Go kickstart is a simple repository that I'm managing to a have a fast setup for Go web application

Go kickstart is a simple repository that I'm managing to a have a fast setup for Go web application with my most common use cases using practices that I found useful and easy to maintain.

Ecommerce-api - Rest api of e-commerce web application
Ecommerce-api - Rest api of e-commerce web application

E-commerce Rest API Swagger documentation to test api Domain diagram

GoVWA - A web application developed to help the pentester and programmers to learn the vulnerabilities

GoVWA - A web application developed to help the pentester and programmers to learn the vulnerabilities

Jeen is a package wrapper that is used as a web application base for the go language.

Jeen Jeen is a package wrapper that is used as a web application base for the go language. Package Wrappers? Yes, because jeen works by using other av

Owner
salem ododa
Software Engineer Python, Go
salem ododa
A web application attack surface mapping tool. It takes in a list of urls then performs numerous probes

sigurlscann3r A web application attack surface mapping tool. It takes in a list of urls then performs numerous probes Resources Features Installation

Signed Security 10 Sep 24, 2022
urlsh is URL shortener application built on Go language.

GOlang URL shortener service with UI, API, Cache, Hits Counter and forwarder using postgres and redis in backend, bulma in frontend

Jitendra Adhikari 125 Dec 11, 2022
GoogleBookAPI is built on top of flogo, a flow based application.

GoogleBookAPI Example GoogleBookAPI is built on top of flogo, a flow based application. Upon launch for first time, the application creates a topic go

Abhishek K 0 Nov 19, 2021
This codebase was created to demonstrate a fully fledged fullstack application built with Golang/Echo including CRUD operations, authentication, routing, pagination, and more.

This codebase was created to demonstrate a fully fledged fullstack application built with Golang/Echo including CRUD operations, authentication, routing, pagination, and more.

Nayef Haidir 3 Jan 6, 2023
A web forum built in Golang and SQLite and designed in SCSS

Forum "Fairfax" ?? What is it? A web forum built in Golang and SQLite and designed in SCSS. Members of the forum can take a personality test and be so

null 2 Nov 10, 2021
BotHub is a web-based robot editor built in go with support for go and python.

Robot Simulator This is an application to simulate toy robot moving on a square tabletop, The robot is free to roam around the surface of the table, b

null 1 May 16, 2022
This application is used as an example HTTP/SQLite application for Litestream tutorials.

This application is used as an example HTTP/SQLite application for Litestream tutorials. It simply maintains a count of HTTP requests and persists it to a SQLite database.

Ben Johnson 12 Apr 2, 2022
A simple database application that I was asked to implement as part of a job application process

This is a simple database application that I was asked to implement as part of a job application process. They told me I could choose any languages an

null 0 Nov 24, 2021
GoTTY - Share your terminal as a web application

GoTTY - Share your terminal as a web application GoTTY is a simple command line tool that turns your CLI tools into web applications. Installation Fro

Soren L. Hansen 1.7k Dec 28, 2022
Retro-Floppy UI is a web based application for managing & using a GoTek floppy emulator running the Flash Floppy firmware.

A web user interface for a GoTek running flashfloppy utilising a Raspberry PI 0W as the storage. This allows for remote uploading of files & selecting which disk image is loaded on a retro computer like the BBC Micro or Amiga A1200

Peter Mount 6 Dec 10, 2022