-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (35 loc) · 1.48 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
export OTEL_SERVICE_NAME := "hetman"
export OTEL_EXPORTER_OTLP_PROTOCOL := "http/protobuf"
export OTEL_EXPORTER_OTLP_ENDPOINT := "http://localhost:4318"
vulncheck:
! command -v govulncheck && go install golang.org/x/vuln/cmd/govulncheck@latest || continue
govulncheck ./...
lint:
go fmt ./...
go clean -testcache
go test -timeout 2m -cover ./...
run-docker:
docker-compose -f test/docker-compose.yml up --remove-orphans --build -d
run:
docker-compose -f test/docker-compose.yml up victoria-metrics grafana-agent loki grafana --remove-orphans -d
[[ -d ./bin ]] || mkdir ./bin
[[ -d ./tmp/tmp_nginx ]] || mkdir -p /tmp/tmp_nginx/
cp ./test/data/nginx.log /tmp/tmp_nginx/nginx.log
cp ./test/data/nginx2.log /tmp/tmp_nginx/nginx2.log
[[ -f /tmp/hetman.registry.json ]] && truncate -s 0 /tmp/hetman.registry.json || continue
CGO_ENABLED=0 go build -o bin ./cmd/hetman
./bin/hetman --mode=agent --config-file=hetman.agent.yaml --log-level=debug
stop:
docker-compose -f test/docker-compose.yml down -v
dashboard:
cd deployment/grafana && \
terraform init && \
terraform apply -auto-approve
run-aggregator: build
./bin/hetman --mode=aggregator --aggregator-port=3101 --config-file=hetman.aggregator.yaml
test-aggregator:
curl -XPOST -H "Content-Type: application/json" -d @test/payload.json http://localhost:3101/logs -v
kill:
ps aux | grep "hetman" | grep -v grep | awk '{ print $$2 }' | xargs kill -9
reload:
kill -HUP $$(ps aux | grep "hetman" | grep -v grep | awk '{ print $$2 }')