Skip to content

Commit 31beb8a

Browse files
committed
use BUILDTAGS env variable for customized build with go build tags
1 parent 3f96a81 commit 31beb8a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

collector/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LAYER_NAME:=otel-collector
77
OTELCOL_VERSION="UNSET" # run recipe set-otelcol-version to get this
88
GIT_SHA=$(shell git rev-parse HEAD)
99
GOARCH ?= amd64
10-
GOBUILD=GO111MODULE=on CGO_ENABLED=0 installsuffix=cgo go build -trimpath
10+
GOBUILD=GO111MODULE=on CGO_ENABLED=0 installsuffix=cgo go build -trimpath$(if ${BUILDTAGS}, -tags "${BUILDTAGS}",)
1111
BUILD_INFO_IMPORT_PATH=main
1212

1313
LDFLAGS=-ldflags "-s -w -X $(BUILD_INFO_IMPORT_PATH).GitHash=$(GIT_SHA) -X $(BUILD_INFO_IMPORT_PATH).Version=$(OTELCOL_VERSION) \

collector/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Once this build-tag is present, you need provide additional build-tags to includ
2929

3030
Each available component can also be included explicitly by using its specific build-tag. For a full-list of available components, have a look into the [lambdacomponents](./collector/lambdacomponents) package.
3131

32-
As an example, the full build command including the following components:
32+
As an example, the full command to publish OpenTelemetry Collector Lambda layer in your AWS account and get its ARN including the following components:
3333
- All receivers
3434
- All processors
3535
- No extensions
@@ -38,7 +38,7 @@ As an example, the full build command including the following components:
3838

3939
would be the following:
4040
```shell
41-
go build -tags "lambdacomponents.custom,lambdacomponents.receiver.all,lambdacomponents.processor.all,lambdacomponents.exporter.otlphttp,lambdacomponents.connector.spanmetrics"
41+
cd collector && BUILDTAGS="lambdacomponents.custom,lambdacomponents.receiver.all,lambdacomponents.processor.all,lambdacomponents.exporter.otlphttp,lambdacomponents.connector.spanmetrics" make publish-layer
4242
```
4343

4444
### Adding additional options

0 commit comments

Comments
 (0)