diff --git a/Makefile b/Makefile index b7322ebf..4937e163 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,15 @@ TO_DIR=dirname {} \; | sort | grep -E '^./' ALL_DISTRIBUTIONS := $(shell find ./distributions/* $(FIND_MOD_ARGS) -exec $(TO_DIR) ) +# Define a delegation target for each distribution +.PHONY: $(ALL_DISTRIBUTIONS) +$(ALL_DISTRIBUTIONS): + $(MAKE) -C $@ $(TARGET) + +# trigger target for each module's delegation target +.PHONY: for-all-target +for-all-target: $(ALL_DISTRIBUTIONS) + include build.mk include check.mk diff --git a/Makefile.common b/Makefile.common index c798c866..dc4f1831 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1,31 +1,63 @@ ############################################# #### Common Makefiles for distributions ##### ############################################# +# Note: file is included in Makefile within distro folders, +# so paths are relative to distro folder unless they use SRC_ROOT # SRC_ROOT is the top of the source tree. SRC_ROOT := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) +BUILD_DIR=$(shell basename $(shell yq '.dist.output_path' 'manifest.yaml')) -FIND_MOD_ARGS=-type f -name "go.mod" -TO_MOD_DIR=dirname {} \; | sort | grep -E '^./' -DISTRIBUTIONS_MODS := $(shell find ./**/* $(FIND_MOD_ARGS) -exec $(TO_MOD_DIR) ) - -## Retrive all used dependencies in the same output -# RESULTS := $(foreach dir,$(DISTRIBUTIONS_MODS),$(shell cd $(dir) && go list -mod=mod -m -json all)) +######################## +#### Check targets ##### +######################## +.PHONY: assert_build-dir +assert_build-dir: + @test $(BUILD_DIR) = _build || (echo "expected build directory _build but was $(BUILD_DIR): required because it is hardcoded for goreleaser" && exit 1) +NOTICE_OUTPUT ?= THIRD_PARTY_NOTICES.md +GO_MOD_TMP_FILE ?= /tmp/tmp_notices.json .PHONY: third-party-notices -third-party-notices: OUT ?= THIRD_PARTY_NOTICES.md -third-party-notices: +third-party-notices: assert_build-dir @command -v go-licence-detector &> /dev/null || (echo "go-license-detector tool not found, install it from the base directory with \"make internal/tools\"" && exit 1) - $(foreach dir,$(DISTRIBUTIONS_MODS),$(shell cd $(dir) && go list -mod=mod -m -json all >> /tmp/tmp_notices.json)) - @go-licence-detector \ - -in /tmp/tmp_notices.json \ - -rules $(SRC_ROOT)/internal/assets/license/rules.json \ - -noticeTemplate $(SRC_ROOT)/internal/assets/license/THIRD_PARTY_NOTICES.md.tmpl \ - -noticeOut $(OUT) - @echo '' > /tmp/tmp_notices.json + echo '' > $(GO_MOD_TMP_FILE);\ + cd $(BUILD_DIR) && go list -mod=mod -m -json all >> $(GO_MOD_TMP_FILE);\ + go-licence-detector \ + -in $(GO_MOD_TMP_FILE) \ + -rules $(SRC_ROOT)/internal/assets/license/rules.json \ + -noticeTemplate $(SRC_ROOT)/internal/assets/license/THIRD_PARTY_NOTICES.md.tmpl \ + -noticeOut $(NOTICE_OUTPUT) .PHONY: third-party-notices-check third-party-notices-check: third-party-notices - @git diff --name-only | grep -q "THIRD_PARTY_NOTICES.md" && { echo "Third party notices out of date, please run \"make licenses\" and commit the changes in this PR."; exit 1; } || exit 0 + @git diff --name-only | grep -q $(NOTICE_OUTPUT) \ + && { \ + echo "Third party notices out of date, please run \"make licenses\" and commit the changes in this PR.";\ + echo "Diff of $(NOTICE_OUTPUT):";\ + git --no-pager diff HEAD -- $(NOTICE_OUTPUT);\ + echo "go.mod file used:";\ + cat $(BUILD_DIR)/go.mod;\ + exit 1;\ + } \ + || exit 0 + + +######################## +#### Build targets ##### +######################## +DISTRO_NAME=$(shell basename $(shell pwd)) +BINARY_NAME=$(shell yq '.dist.name' 'manifest.yaml') + +build-distro: assert_build-dir $(BUILD_DIR)/$(BINARY_NAME) +$(BUILD_DIR)/$(BINARY_NAME): manifest.yaml + $(SRC_ROOT)/scripts/build.sh -d $(DISTRO_NAME) + +generate-sources-for-distro: assert_build-dir $(BUILD_DIR)/go.mod +$(BUILD_DIR)/go.mod: manifest.yaml + $(SRC_ROOT)/scripts/build.sh -d $(DISTRO_NAME) -s true + +.PHONY: clean-build-dir-distro +clean-build-dir-distro: + rm -rf $(BUILD_DIR) diff --git a/build.mk b/build.mk index 41df8625..3bb3bfc0 100644 --- a/build.mk +++ b/build.mk @@ -1,59 +1,14 @@ -GO ?= go -GORELEASER ?= goreleaser - -OTELCOL_BUILDER_VERSION ?= 0.108.0 -OTELCOL_BUILDER_DIR ?= ${HOME}/bin -OTELCOL_BUILDER ?= ${OTELCOL_BUILDER_DIR}/ocb - -DISTRIBUTIONS ?= "nr-otel-collector" - +.PHONY: ci ci: build -build: go ocb - @./scripts/build.sh -d "${DISTRIBUTIONS}" -b ${OTELCOL_BUILDER} -g ${GO} - -generate: generate-sources - -generate-sources: go ocb - @./scripts/build.sh -d "${DISTRIBUTIONS}" -s true -b ${OTELCOL_BUILDER} -g ${GO} - -goreleaser-verify: goreleaser - @${GORELEASER} release --snapshot --rm-dist - -.PHONY: ocb -ocb: -ifeq (, $(shell command -v ocb 2>/dev/null)) - @{ \ - [ ! -x '$(OTELCOL_BUILDER)' ] || exit 0; \ - set -e ;\ - os=$$(uname | tr A-Z a-z) ;\ - machine=$$(uname -m) ;\ - [ "$${machine}" != x86 ] || machine=386 ;\ - [ "$${machine}" != x86_64 ] || machine=amd64 ;\ - [ "$${machine}" != aarch64 ] || machine=arm64 ;\ - echo "Installing ocb ($${os}/$${machine}) at $(OTELCOL_BUILDER_DIR)";\ - mkdir -p $(OTELCOL_BUILDER_DIR) ;\ - curl -sLo $(OTELCOL_BUILDER) "https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/cmd%2Fbuilder%2Fv$(OTELCOL_BUILDER_VERSION)/ocb_$(OTELCOL_BUILDER_VERSION)_$${os}_$${machine}" ;\ - chmod +x $(OTELCOL_BUILDER) ;\ - } -else -OTELCOL_BUILDER=$(shell command -v ocb) -endif +.PHONY: build +build: + @$(MAKE) for-all-target TARGET="build-distro" -.PHONY: go -go: - @{ \ - if ! command -v '$(GO)' >/dev/null 2>/dev/null; then \ - echo >&2 '$(GO) command not found. Please install golang. https://go.dev/doc/install'; \ - exit 1; \ - fi \ - } +.PHONY: generate-sources +generate-sources: + @$(MAKE) for-all-target TARGET="generate-sources-for-distro" -.PHONY: goreleaser -goreleaser: - @{ \ - if ! command -v '$(GORELEASER)' >/dev/null 2>/dev/null; then \ - echo >&2 '$(GORELEASER) command not found. Please install goreleaser. https://goreleaser.com/install/'; \ - exit 1; \ - fi \ - } +.PHONY: clean-build-dir +clean-build-dir: + @$(MAKE) for-all-target TARGET="clean-build-dir-distro" diff --git a/check.mk b/check.mk index 97ae73c7..db4c3174 100644 --- a/check.mk +++ b/check.mk @@ -1,20 +1,7 @@ - -GROUP ?= all -FOR_GROUP_TARGET=for-$(GROUP)-target - -# Define a delegation target for each distribution -.PHONY: $(ALL_DISTRIBUTIONS) -$(ALL_DISTRIBUTIONS): - $(MAKE) -C $@ $(TARGET) - -# Trigger each module's delegation target -.PHONY: for-all-target -for-all-target: $(ALL_DISTRIBUTIONS) - .PHONY: licenses -licenses: internal/tools build - @$(MAKE) $(FOR_GROUP_TARGET) TARGET="third-party-notices" +licenses: internal/tools generate-sources + @$(MAKE) for-all-target TARGET="third-party-notices" .PHONY: licenses-check -licenses-check: internal/tools build - @$(MAKE) $(FOR_GROUP_TARGET) TARGET="third-party-notices-check" +licenses-check: internal/tools generate-sources + @$(MAKE) for-all-target TARGET="third-party-notices-check" diff --git a/configs/nr-otel-collector-agent-linux.yaml b/configs/nr-otel-collector-agent-linux.yaml index 0892e290..3d5ab7d3 100644 --- a/configs/nr-otel-collector-agent-linux.yaml +++ b/configs/nr-otel-collector-agent-linux.yaml @@ -202,7 +202,7 @@ processors: override: true exporters: - logging: + debug: otlphttp: endpoint: ${OTEL_EXPORTER_OTLP_ENDPOINT} headers: @@ -230,22 +230,22 @@ service: - resourcedetection/env - cumulativetodelta - batch - exporters: [logging, otlphttp] + exporters: [debug, otlphttp] logs/host: receivers: [filelog] processors: [transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] - exporters: [logging, otlphttp] + exporters: [debug, otlphttp] traces: receivers: [otlp] processors: [transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] - exporters: [logging, otlphttp] + exporters: [debug, otlphttp] metrics: receivers: [otlp] processors: [transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] - exporters: [logging, otlphttp] + exporters: [debug, otlphttp] logs: receivers: [otlp] processors: [transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] - exporters: [logging, otlphttp] + exporters: [debug, otlphttp] extensions: [health_check] diff --git a/configs/nr-otel-collector-gateway.yaml b/configs/nr-otel-collector-gateway.yaml index 873a9f66..17e55b80 100644 --- a/configs/nr-otel-collector-gateway.yaml +++ b/configs/nr-otel-collector-gateway.yaml @@ -22,7 +22,7 @@ processors: limit_mib: ${NEW_RELIC_MEMORY_LIMIT_MIB} exporters: - logging: + debug: verbosity: detailed otlp: endpoint: ${OTEL_EXPORTER_OTLP_ENDPOINT} @@ -36,11 +36,11 @@ service: traces: receivers: [otlp] processors: [memory_limiter, batch] - exporters: [logging, otlp] + exporters: [debug, otlp] metrics: receivers: [otlp] processors: [memory_limiter, batch] - exporters: [logging, otlp] + exporters: [debug, otlp] extensions: [health_check] diff --git a/distributions/nr-otel-collector/THIRD_PARTY_NOTICES.md b/distributions/nr-otel-collector/THIRD_PARTY_NOTICES.md index a0116433..515b90fe 100644 --- a/distributions/nr-otel-collector/THIRD_PARTY_NOTICES.md +++ b/distributions/nr-otel-collector/THIRD_PARTY_NOTICES.md @@ -1,22 +1,13 @@ # Third Party Notices -The New Relic infrastructure agent uses source code from third -party libraries which carry -their own copyright notices and license terms. These notices ar -e provided -below. +The New Relic infrastructure agent uses source code from third party libraries which carry their own copyright notices +and license terms. These notices are provided below. -In the event that a required notice is missing or incorrect, pl -ease notify us -either by [opening an issue](https://github.com/newrelic/infras -tructure-agent/issues/new), -or by e-mailing [open-source@newrelic.com](mailto:open-source@n -ewrelic.com). +In the event that a required notice is missing or incorrect, please notify us by e-mailing +[open-source@newrelic.com](mailto:open-source@newrelic.com). -For any licenses that require the disclosure of source code, th -e source code -can be found at https://github.com/newrelic/infrastructure-agen -t/. +For any licenses that require the disclosure of source code, the source code +can be found at https://github.com/newrelic/opentelemetry-collector-releases. @@ -253,7 +244,7 @@ Distributed under the following license(s): -## [go.opentelemetry.io/collector/exporter/loggingexporter](https://go.opentelemetry.io/collector/exporter/loggingexporter) +## [go.opentelemetry.io/collector/exporter/debugexporter](https://go.opentelemetry.io/collector/exporter/debugexporter) Distributed under the following license(s): diff --git a/distributions/nr-otel-collector/manifest.yaml b/distributions/nr-otel-collector/manifest.yaml index ef09ecb6..2284dbed 100644 --- a/distributions/nr-otel-collector/manifest.yaml +++ b/distributions/nr-otel-collector/manifest.yaml @@ -4,42 +4,49 @@ dist: description: New Relic OpenTelemetry Collector version: 0.8.7 output_path: ./_build - otelcol_version: 0.108.0 + otelcol_version: 0.112.0 extensions: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.108.0 - - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.108.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.112.0 + - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.112.0 exporters: - - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.108.0 - - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.108.0 - - gomod: go.opentelemetry.io/collector/exporter/loggingexporter v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.108.0 + - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.112.0 + - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.112.0 + - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.112.0 processors: - - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.108.0 - - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstransformprocessor v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.108.0 + - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.112.0 + - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstransformprocessor v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.112.0 receivers: - - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/dockerstatsreceiver v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8seventsreceiver v0.108.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver v0.108.0 + - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/dockerstatsreceiver v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8seventsreceiver v0.112.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver v0.112.0 + +providers: + - gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.18.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.18.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/httpprovider v1.18.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.18.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.18.0 # When adding a replace, add a comment before it to document why it's needed and when it can be removed replaces: diff --git a/internal/assets/license/THIRD_PARTY_NOTICES.md.tmpl b/internal/assets/license/THIRD_PARTY_NOTICES.md.tmpl index 71be3bf4..a6f148dc 100644 --- a/internal/assets/license/THIRD_PARTY_NOTICES.md.tmpl +++ b/internal/assets/license/THIRD_PARTY_NOTICES.md.tmpl @@ -12,23 +12,14 @@ Distributed under the following license(s): # Third Party Notices -The New Relic infrastructure agent uses source code from third -party libraries which carry -their own copyright notices and license terms. These notices ar -e provided -below. - -In the event that a required notice is missing or incorrect, pl -ease notify us -either by [opening an issue](https://github.com/newrelic/infras -tructure-agent/issues/new), -or by e-mailing [open-source@newrelic.com](mailto:open-source@n -ewrelic.com). - -For any licenses that require the disclosure of source code, th -e source code -can be found at https://github.com/newrelic/infrastructure-agen -t/. +The New Relic infrastructure agent uses source code from third party libraries which carry their own copyright notices +and license terms. These notices are provided below. + +In the event that a required notice is missing or incorrect, please notify us by e-mailing +[open-source@newrelic.com](mailto:open-source@newrelic.com). + +For any licenses that require the disclosure of source code, the source code +can be found at https://github.com/newrelic/opentelemetry-collector-releases. {{ template "depInfo" .Direct }} diff --git a/scripts/build.sh b/scripts/build.sh index e365562a..097f39f9 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,28 +1,23 @@ #!/bin/bash REPO_DIR="$( cd "$(dirname $( dirname "${BASH_SOURCE[0]}" ))" &> /dev/null && pwd )" -BUILDER='' -GO='' +# flag for ci-only behavior (CI is auto-populated with 'true' in github actions) +ensure_docker_write_permissions=$CI # default values skipcompilation=false -while getopts d:s:b:g: flag +while getopts d:s: flag do case "${flag}" in - d) distributions=${OPTARG};; + d) distribution=${OPTARG};; s) skipcompilation=${OPTARG};; - b) BUILDER=${OPTARG};; - g) GO=${OPTARG};; esac done -[[ -n "$BUILDER" ]] || BUILDER='ocb' -[[ -n "$GO" ]] || GO='go' - -if [[ -z $distributions ]]; then - echo "List of distributions to build not provided. Use '-d' to specify the names of the distributions to build. Ex.:" - echo "$0 -d otelcol" +if [[ -z $distribution ]]; then + echo "Distribution to build not provided. Use '-d' to specify the name of the distribution to build. Ex.:" + echo "$0 -d nr-otel-collector" exit 1 fi @@ -30,27 +25,40 @@ if [[ "$skipcompilation" = true ]]; then echo "Skipping the compilation, we'll only generate the sources." fi -echo "Distributions to build: $distributions"; +echo "Distribution to build: $distribution"; -for distribution in $(echo "$distributions" | tr "," "\n") -do - pushd "${REPO_DIR}/distributions/${distribution}" > /dev/null - mkdir -p _build - - echo "Building: $distribution" - echo "Using Builder: $(command -v "$BUILDER")" - echo "Using Go: $(command -v "$GO")" - - if "$BUILDER" --skip-compilation=${skipcompilation} --go "$GO" --config manifest.yaml > _build/build.log 2>&1; then - echo "✅ SUCCESS: distribution '${distribution}' built." - else - echo "❌ ERROR: failed to build the distribution '${distribution}'." - echo "🪵 Build logs for '${distribution}'" - echo "----------------------" - cat _build/build.log - echo "----------------------" - exit 1 - fi - - popd > /dev/null -done +pushd "${REPO_DIR}/distributions/${distribution}" > /dev/null +ocb_config="manifest.yaml" +output_dir=$(yq '.dist.output_path' "${ocb_config}") +echo "Output dir: $(pwd)/${output_dir}" +if [[ -d "${output_dir}" ]]; then + # cleanup build dir as reruns of workflows seem to reuse the same filesystem + rm -rf "${output_dir}" +fi +mkdir "${output_dir}" +if [[ "$ensure_docker_write_permissions" == "true" ]]; then + # ocb dockerfile user/group id is 10001 (https://github.com/open-telemetry/opentelemetry-collector-releases/blob/main/cmd/builder/Dockerfile#L6) + sudo chown 10001:10001 "${output_dir}" +fi + +builder_version=$(yq '.dist.otelcol_version' "${ocb_config}") +builder_image="otel/opentelemetry-collector-builder:${builder_version}" +docker pull "${builder_image}" + +container_work_dir=$(docker image inspect -f '{{.Config.WorkingDir}}' ${builder_image}) +container_path_ocb_config="${container_work_dir}/${ocb_config}" + +echo "Building: $distribution" +docker run \ + -v "$(pwd)/${ocb_config}:${container_path_ocb_config}" \ + -v "$(pwd)/${output_dir}:${container_work_dir}/${output_dir}:rw" \ + "${builder_image}" \ + --config "${container_path_ocb_config}" \ + --skip-compilation=${skipcompilation} + +if [[ "$ensure_docker_write_permissions" == "true" ]]; then + # change owner of output dir back to the 'build' user to allow access for following steps + sudo chown -R $(id -u):$(id -g) "${output_dir}" +fi + +popd > /dev/null diff --git a/test/canaries/templates/nr-otel-collector-agent.yml.j2 b/test/canaries/templates/nr-otel-collector-agent.yml.j2 index 072db01d..14ff4254 100644 --- a/test/canaries/templates/nr-otel-collector-agent.yml.j2 +++ b/test/canaries/templates/nr-otel-collector-agent.yml.j2 @@ -189,7 +189,7 @@ processors: enabled: false exporters: - logging: + debug: otlp: endpoint: https://staging-otlp.nr-data.net:4317 headers: @@ -215,14 +215,14 @@ service: - resourcedetection - resourcedetection/cloud - resource - exporters: [logging,otlp] + exporters: [debug,otlp] traces: receivers: [otlp] processors: [transform, resourcedetection, resourcedetection/cloud, resource, batch] - exporters: [logging, otlp] + exporters: [debug, otlp] logs: receivers: [otlp, filelog] processors: [transform, resourcedetection, resourcedetection/cloud, resource, batch] - exporters: [logging, otlp] + exporters: [debug, otlp] extensions: [health_check]