Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
APM-317073 - logging AWS log forwarder stack version (#47)
Browse files Browse the repository at this point in the history
APM-317073 - logging AWS log forwarder stack version in forwarder Lambda's log
  • Loading branch information
bmrozinski-dt authored Nov 25, 2021
1 parent f159a65 commit 20c6257
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ def handler(event, lambda_context):
dt_token = os.environ.get('DYNATRACE_API_KEY')
verify_SSL = os.environ.get('VERIFY_SSL', 'false') == 'true'

try:
with open('version.txt') as versionFile:
version = versionFile.readline()
except Exception as e:
version = "?"
log_multiline_message(f"Couldn't read stack version. Exception: '{e}'.", "version-reading-exception")

log_multiline_message("LOG FORWARDER version=" + version, "handler")

ensure_credentials_provided(dt_token, dt_url)

records = event['records']
Expand Down

0 comments on commit 20c6257

Please sign in to comment.