Skip to content

Commit

Permalink
Integrate Beyla without eBPF binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelroquetto committed Feb 15, 2025
1 parent 60596bb commit 1d93553
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 65 deletions.
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ GO_LDFLAGS := -X $(VPREFIX).Branch=$(GIT_BRANCH) \
-X $(VPREFIX).BuildUser=$(shell whoami)@$(shell hostname) \
-X $(VPREFIX).BuildDate=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")

GO_BUILTIN_TAGS := beyla_bpf $(GO_TAGS)
DEFAULT_FLAGS := $(GO_FLAGS)
DEBUG_GO_FLAGS := -ldflags "$(GO_LDFLAGS)" -tags "$(GO_TAGS)"
RELEASE_GO_FLAGS := -ldflags "-s -w $(GO_LDFLAGS)" -tags "$(GO_TAGS)"
DEBUG_GO_FLAGS := -ldflags "$(GO_LDFLAGS)" -tags "$(GO_BUILTIN_TAGS)"
RELEASE_GO_FLAGS := -ldflags "-s -w $(GO_LDFLAGS)" -tags "$(GO_BUILTIN_TAGS)"

ifeq ($(RELEASE_BUILD),1)
GO_FLAGS := $(DEFAULT_FLAGS) $(RELEASE_GO_FLAGS)
Expand All @@ -139,7 +140,7 @@ lint: alloylint
# We have to run test twice: once for all packages with -race and then once
# more without -race for packages that have known race detection issues. The
# final command runs tests for all other submodules.
test:
test: generate-beyla
$(GO_ENV) go test $(GO_FLAGS) -race $(shell go list ./... | grep -v /integration-tests/)
$(GO_ENV) go test $(GO_FLAGS) ./internal/static/integrations/node_exporter ./internal/static/logs ./internal/component/otelcol/processor/tail_sampling ./internal/component/loki/source/file ./internal/component/loki/source/docker
$(GO_ENV) find . -name go.mod -not -path "./go.mod" -execdir go test -race ./... \;
Expand All @@ -163,7 +164,7 @@ integration-test:
.PHONY: binaries alloy
binaries: alloy

alloy:
alloy: generate-beyla
ifeq ($(USE_CONTAINER),1)
$(RERUN_IN_CONTAINER)
else
Expand All @@ -178,7 +179,7 @@ else
$(GO_ENV) go build $(GO_FLAGS) -o $(SERVICE_BINARY) ./internal/cmd/alloy-service
endif

alloylint:
alloylint: generate-beyla
ifeq ($(USE_CONTAINER),1)
$(RERUN_IN_CONTAINER)
else
Expand Down Expand Up @@ -273,6 +274,13 @@ drone: generate-drone
drone lint .drone/drone.yml --trusted
drone --server https://drone.grafana.net sign --save grafana/alloy .drone/drone.yml

# Required by vendored Beyla to build eBPF artifacts prior to building the
# Alloy binary
.PHONY: generate-beyla
generate-beyla:
@go mod vendor
@go generate vendor/github.com/grafana/beyla/bpf/build_ebpf.go > /dev/null

.PHONY: clean
clean: clean-dist clean-build-container-cache
rm -rf ./build/*
Expand Down
41 changes: 21 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ require (
github.com/gorilla/mux v1.8.1
github.com/grafana/alloy-remote-config v0.0.10
github.com/grafana/alloy/syntax v0.1.0
github.com/grafana/beyla v1.10.0-alloy // custom beyla 1.10 branch without git lfs
github.com/grafana/beyla v1.9.1-0.20250215005758-871427459fd5
github.com/grafana/catchpoint-prometheus-exporter v0.0.0-20240606062944-e55f3668661d
github.com/grafana/ckit v0.0.0-20241128150632-1e6dfe1c6183
github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2
Expand Down Expand Up @@ -237,31 +237,31 @@ require (
go.opentelemetry.io/collector/semconv v0.116.0
go.opentelemetry.io/collector/service v0.116.0
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.45.0
go.opentelemetry.io/otel v1.32.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.32.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0
go.opentelemetry.io/otel v1.34.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.34.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0
go.opentelemetry.io/otel/exporters/prometheus v0.54.0
go.opentelemetry.io/otel/metric v1.32.0
go.opentelemetry.io/otel/sdk v1.32.0
go.opentelemetry.io/otel/sdk/metric v1.32.0
go.opentelemetry.io/otel/trace v1.32.0
go.opentelemetry.io/proto/otlp v1.3.1
go.opentelemetry.io/otel/metric v1.34.0
go.opentelemetry.io/otel/sdk v1.34.0
go.opentelemetry.io/otel/sdk/metric v1.34.0
go.opentelemetry.io/otel/trace v1.34.0
go.opentelemetry.io/proto/otlp v1.5.0
go.uber.org/atomic v1.11.0
go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.32.0
golang.org/x/crypto/x509roots/fallback v0.0.0-20240208163226-62c9f1799c91
golang.org/x/exp v0.0.0-20241210194714-1829a127f884
golang.org/x/net v0.33.0
golang.org/x/net v0.34.0
golang.org/x/oauth2 v0.24.0
golang.org/x/sys v0.29.0
golang.org/x/text v0.21.0
golang.org/x/time v0.6.0
golang.org/x/tools v0.28.0
google.golang.org/api v0.193.0
google.golang.org/grpc v1.68.1
google.golang.org/protobuf v1.35.2
google.golang.org/grpc v1.69.4
google.golang.org/protobuf v1.36.3
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools v2.2.0+incompatible
Expand Down Expand Up @@ -484,7 +484,7 @@ require (
github.com/ema/qdisc v1.0.0 // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/envoyproxy/go-control-plane v0.13.0 // indirect
github.com/envoyproxy/go-control-plane v0.13.1 // indirect
github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect
github.com/euank/go-kmsg-parser v2.0.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
Expand Down Expand Up @@ -549,7 +549,7 @@ require (
github.com/grafana/snowflake-prometheus-exporter v0.0.0-20240813124544-9995e8354548
github.com/grobie/gomemcache v0.0.0-20230213081705-239240bbc445 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/hashicorp/cronexpr v1.1.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand Down Expand Up @@ -786,14 +786,14 @@ require (
go.opentelemetry.io/contrib/detectors/aws/ec2 v1.28.0 // indirect
go.opentelemetry.io/contrib/detectors/aws/eks v1.28.0 // indirect
go.opentelemetry.io/contrib/detectors/azure/azurevm v0.0.1 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.28.0 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.31.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect
go.opentelemetry.io/contrib/propagators/b3 v1.31.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.7.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.32.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.32.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.31.0 // indirect
go.opentelemetry.io/otel/log v0.8.0 // indirect
Expand All @@ -809,8 +809,8 @@ require (
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
gonum.org/v1/gonum v0.15.1 // indirect
google.golang.org/genproto v0.0.0-20240820151423-278611b39280 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect
gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand Down Expand Up @@ -886,6 +886,7 @@ require (
github.com/panjf2000/ants/v2 v2.11.0 // indirect
github.com/pires/go-proxyproto v0.7.0 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
golang.design/x/chann v0.1.2 // indirect
)

Expand Down
Loading

0 comments on commit 1d93553

Please sign in to comment.