Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add buildpack_version tag to logs, traces and metrics #166

Merged
merged 1 commit into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ cp -r "${ROOT_DIR}/lib/test-endpoint.sh" "${BUILD_DIR}/.profile.d/00-test-endpoi
cp "${ROOT_DIR}/lib/run-datadog.sh" "${BUILD_DIR}/.profile.d/01-run-datadog.sh"
cp "${ROOT_DIR}/lib/redirect-logs.sh" "${BUILD_DIR}/.profile.d/02-redirect-logs.sh"

cp "${ROOT_DIR}/VERSION" "${DATADOG_DIR}/VERSION"

if [ -f "${DATADOG_DIR}/agent" ]; then
chmod +x "${DATADOG_DIR}/agent"
fi
Expand Down
2 changes: 2 additions & 0 deletions bin/supply
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ cp -r "${ROOT_DIR}/lib/test-endpoint.sh" "${BUILD_DIR}/.profile.d/00-test-endpoi
cp "${ROOT_DIR}/lib/run-datadog.sh" "${BUILD_DIR}/.profile.d/01-run-datadog.sh"
cp "${ROOT_DIR}/lib/redirect-logs.sh" "${BUILD_DIR}/.profile.d/02-redirect-logs.sh"

cp "${ROOT_DIR}/VERSION" "${DATADOG_DIR}/VERSION"

if [ -f "${DATADOG_DIR}/agent" ]; then
chmod +x "${DATADOG_DIR}/agent"
fi
Expand Down
6 changes: 6 additions & 0 deletions lib/scripts/get_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ def parse_tags(tags):
except Exception as e:
print("there was an issue parsing the tags in DD_TAGS: {}".format(e))

version_file = "/home/vcap/app/.datadog/VERSION"
if os.path.exists(version_file):
with open(version_file, 'r') as file:
buildpack_version = file.read().rstrip()
tags.append("buildpack_version:{}".format(buildpack_version))

tags = [ tag.replace(" ", "_") for tag in tags ]
tags = list(dict.fromkeys(tags))

Expand Down