Skeleton of the golang project.
NOTE: this is not a universal skeleton - one option, among others.
- config from Consul
- reloader
- vault
- config zap logger for dev and prod
- (option) integration to Sentry
- metrics collection (prometheus)
- e2e tests
- go
- (experiments) java
- (experiments) python
- (experiments) nodejs
- right main.go
- step-by-step application start
- handle termination os signals
- graceful shutdown
Tools:
- Code generation
Follow an example of an API (gRPC + gRPC-web + REST) + e2e tests
Configure prometheus via Consul service discovery.
global:
scrape_interval: 15s
evaluation_interval: 15s
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
- 127.0.0.1:9093
rule_files:
- "/etc/prometheus/rules/*.rules"
scrape_configs:
- job_name: 'consul_sd'
consul_sd_configs:
- server: 'localhost:8500'
services: []
relabel_configs:
- source_labels: ['__meta_consul_service']
regex: '(.*)consul(.*)'
action: drop
- source_labels: ['__meta_consul_node']
target_label: instance
- source_labels: ['__meta_consul_service']
target_label: service
- source_labels: ['__meta_consul_tags']
target_label: tagsTODO: Example config Alertmanager for gRPC