This is a simple event to log web service to register any kind of events like deployments, alerts, code analysis and whatever you believe that needs to be registered.
export PORT=9090
export APP_NAME=event-logger
export LOG_LEVEL=INFO
export USEPROMETHEUS=true
TIP: Export USEPROMETHEUS=true
to enable /metrics
endpoint.
The project is using Go Modules for dependency management Module: github.com/betorvs/event-logger
Run the tests
TESTRUN=true go test ./... -coverprofile=cover.out
go tool cover -html=cover.out
Install golangci-lint and run lint:
golangci-lint run
docker build .
#!/usr/bin/env bash
curl -v -X POST -H "Content-Type: application/json" -d '{
"name": "test1",
"kind": "test",
"labels": {
"testa": "testa1"
},
"message": "test1 event logging",
"source": "curl command",
"status": 2
}' \
http://localhost:9090/event-logger/v1/event
The project was initialized using Golang Spell.
The Architectural Model adopted to structure the application is based on The Clean Architecture. Further details can be found here: The Clean Architecture and in the Clean Architecture Book.