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

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"},
```
Owner
salem ododa
Software Engineer Python, Go
salem ododa
Similar Resources

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

Oct 21, 2021

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

Oct 25, 2021

๐Ÿ––๐Ÿป 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

May 13, 2022

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

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

Dec 20, 2021

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

Jan 4, 2022

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.

Jan 30, 2022

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

May 1, 2022

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

Feb 12, 2022

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

Feb 21, 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

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.

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

Mar 22, 2022
sigurlx a web application attack surface mapping tool.

sigurlx a web application attack surface mapping tool, it does ...:

Jul 24, 2021
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

Nov 5, 2021
A web forum built in Golang and SQLite and designed in SCSS
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

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

May 8, 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.

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

Nov 24, 2021
GoTTY - Share your terminal as a web application
 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

May 11, 2022
Retro-Floppy UI is a web based application for managing & using a GoTek floppy emulator running the Flash Floppy firmware.
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

Aug 26, 2021