Skip to content
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
14 changes: 12 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ on:
schedule:
- cron: '45 5 * * *'
workflow_dispatch:
inputs:
runtimes:
description: 'Node.js runtimes to test instead of the ones the article lists (e.g. nodejs24.x nodejs26.x)'
type: string

permissions:
id-token: write
Expand All @@ -58,6 +62,7 @@ env:
LAMBDA_ROLE_ARN: arn:aws:iam::352333568934:role/e2e-lambda-exec
API: https://telemetry.betterstack.com
DOCS_URL: https://betterstack.com/docs/logs/aws-lambda/
RUNTIMES_OVERRIDE: ${{ inputs.runtimes }}
RUN_ID: gh${{ github.run_id }}a${{ github.run_attempt }}
# The article asks for Python 3.7 or higher; these are the oldest and the newest Python runtimes Lambda supports.
PYTHON_RUNTIMES: python3.11 python3.14
Expand Down Expand Up @@ -98,7 +103,7 @@ jobs:
repository = os.environ['GITHUB_REPOSITORY']
page = open('docs.html', encoding='utf-8').read()
blocks = [(language, html.unescape(re.sub(r'<[^>]+>', '', code)).strip())
for language, code in re.findall(r"<pre class='highlight language-(\w+)'><code>(.*?)</code></pre>", page, re.S)]
for language, code in re.findall(r"<pre class='(?:[^']* )?language-(\w+)'><code[^>]*>(.*?)</code></pre>", page, re.S)]
ROLES = ['Node.js install', 'Node.js environment variables', 'Node.js logging', 'Python install', 'Python setup', 'Python logging']
LANGUAGES = ['bash', 'text', 'js', 'bash', 'python', 'python']
if [language for language, _ in blocks] != LANGUAGES:
Expand Down Expand Up @@ -142,6 +147,9 @@ jobs:
if install == 'download' and options['--zip-file'][0].removeprefix('fileb://').removeprefix('./') != zip_name:
problems.append(f"the layer publish command uploads {options['--zip-file'][0]}, the article downloads {zip_name}")

if os.environ['RUNTIMES_OVERRIDE']:
options['--compatible-runtimes'] = os.environ['RUNTIMES_OVERRIDE'].split()

# Node.js environment variables: "NAME: value" lines, values may carry the article's placeholders.
environment = {}
for line in node_env.splitlines():
Expand Down Expand Up @@ -529,8 +537,10 @@ jobs:
sys.exit(f"::error::SQL API on {env['CONNECT_HOST']} answered HTTP {error.code}: {body[:300]}")

# The collection belongs to this job's source alone, so apart from the warm-up lines every row is the function's.
# The nodejs26.x runtime itself logs one "[tls-profile] applied …" line on a cold start, which is left out too.
QUERY = (f"SELECT toUnixTimestamp64Milli(dt) AS dt_ms, toUnixTimestamp64Milli(ingest_time) AS ingest_ms, raw "
f"FROM remote({env['COLLECTION']}_logs) WHERE position(raw, 'e2e warm-up run_id=') = 0 ORDER BY dt, _insert_index")
f"FROM remote({env['COLLECTION']}_logs) WHERE position(raw, 'e2e warm-up run_id=') = 0 "
f"AND position(raw, '[tls-profile] applied ') = 0 ORDER BY dt, _insert_index")
last_returned = invocations[-1]['returned_at']
deadline = time.time() + int(env['READBACK_SECONDS'])
while True:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [22, 24]
node-version: [22, 24, 26]
steps:
- name: Checkout from repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $ curl -fsSLO https://github.com/logtail/logtail-lambda-extension/releases/lates
$ aws lambda publish-layer-version \
--layer-name "logtail-lambda-extension" \
--zip-file "fileb://logtail-lambda-extension.zip" \
--compatible-runtimes nodejs22.x nodejs24.x \
--compatible-runtimes nodejs22.x nodejs24.x nodejs26.x \
--compatible-architectures x86_64 arm64
```

Expand Down
Loading