-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
54 lines (44 loc) · 2.28 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
46
47
48
49
50
51
52
53
54
GOARCH := $(shell go env GOARCH)
.PHONY: setup # Set up required tools (builder, mdatagen)
setup:
git clone https://github.com/open-telemetry/opentelemetry-collector.git ./opentelemetry-collector
cd ./opentelemetry-collector && git checkout v0.104.0
cd ./opentelemetry-collector/cmd/builder && go build -o builder .
cd ./opentelemetry-collector/cmd/mdatagen && go build -o mdatagen .
.PHONY: audit-logs-metadata # Generating Audit Logs receiver's metadata
audit-logs-metadata:
cd auditlogsreceiver && ../opentelemetry-collector/cmd/mdatagen/mdatagen metadata.yaml
.PHONY: build # Generate and build collector
build: audit-logs-metadata
$(BUILD_ARGS) ./opentelemetry-collector/cmd/builder/builder --config builder-config.yaml
.PHONY: run # Run a default collector that outputs everything to console
run:
./castai-collector/castai-collector --config collector-config.yaml
# =======================
# Docker related targets.
.PHONY: docker # Build docker image and storing it locally
docker: BUILD_ARGS:=GOOS=linux
docker: build
cd castai-collector && GOOS=linux CGO_ENABLED=0 go build -o castai-collector-$(GOARCH)
docker build -t castai-collector .
.PHONY: run-docker # Launch local docker image
run-docker: docker
docker run -e CASTAI_API_URL="$(CASTAI_API_URL)" -e CASTAI_API_KEY="$(CASTAI_API_KEY)" castai-collector:latest
# ==================================================
# Targets to run an example that uses file exporter.
.PHONY: run-file # Run a collector that exports Audit Logs to Grafana Loki
run-file:
./castai-collector/castai-collector --config ./examples/file/collector-config.yaml
# ==================================================
# Targets to run an example that uses Loki exporter.
.PHONY: run-loki-server # Start Grafana Loki via docker compose
run-loki-server:
docker-compose -f examples/loki/docker-compose.yaml up -d
.PHONY: run-loki # Run a collector that exports Audit Logs to Grafana Loki
run-loki:
./castai-collector/castai-collector --config ./examples/loki/collector-config.yaml
# =======================================================
# Targets to run an example that uses Coralogix exporter.
.PHONY: run-coralogix # Run a collector that exports Audit Logs to Grafana Loki
run-coralogix:
./castai-collector/castai-collector --config ./examples/coralogix/collector-config.yaml