Skip to content

Commit

Permalink
Add .sha256 file to the release note as an asset
Browse files Browse the repository at this point in the history
  • Loading branch information
harrryr committed Dec 18, 2024
2 parents a5bf4c7 + 87ec407 commit 2228552
Show file tree
Hide file tree
Showing 39 changed files with 3,618 additions and 540 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/daily-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
id: high_scan
uses: ./.github/actions/image_scan
with:
image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-node:v0.3.0"
image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-node:v0.4.0"
severity: 'CRITICAL,HIGH'

# TODO: Update image to public once available
Expand All @@ -82,7 +82,7 @@ jobs:
id: low_scan
uses: ./.github/actions/image_scan
with:
image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-node:v0.3.0"
image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-node:v0.4.0"
severity: 'MEDIUM,LOW,UNKNOWN'

- name: Configure AWS Credentials for emitting metrics
Expand Down
30 changes: 8 additions & 22 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env:
RELEASE_PRIVATE_REPOSITORY: 020628701572.dkr.ecr.us-west-2.amazonaws.com/adot-autoinstrumentation-node
RELEASE_PRIVATE_REGISTRY: 020628701572.dkr.ecr.us-west-2.amazonaws.com
PACKAGE_NAME: aws-distro-opentelemetry-node-autoinstrumentation
ARTIFACT_NAME: aws-aws-distro-opentelemetry-node-autoinstrumentation-${{ github.event.inputs.version }}.tgz

permissions:
id-token: write
Expand Down Expand Up @@ -86,6 +87,11 @@ jobs:
tags: |
${{ env.RELEASE_PRIVATE_REPOSITORY }}:v${{ github.event.inputs.version }}
- name: Get SHA256 checksum of release artifact
id: get_sha256
run: |
shasum -a 256 aws-distro-opentelemetry-node-autoinstrumentation/${{ env.ARTIFACT_NAME }} | sed "s|aws-distro-opentelemetry-node-autoinstrumentation/||" > ${{ env.ARTIFACT_NAME }}.sha256
# Publish to GitHub releases
- name: Create GH release
id: create_release
Expand All @@ -96,34 +102,14 @@ jobs:
--title "Release v${{ github.event.inputs.version }}" \
--draft \
"v${{ github.event.inputs.version }}" \
aws-distro-opentelemetry-node-autoinstrumentation/aws-aws-distro-opentelemetry-node-autoinstrumentation-${{ github.event.inputs.version }}.tgz
aws-distro-opentelemetry-node-autoinstrumentation/${{ env.ARTIFACT_NAME }} \
${{ env.ARTIFACT_NAME }}.sha256
# Publish to npm
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
run: npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes

- name: Get SHA256 checksum of wheel file
id: get_sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
checksum=$(shasum -a 256 aws-distro-opentelemetry-node-autoinstrumentation/aws-aws-distro-opentelemetry-node-autoinstrumentation-${{ github.event.inputs.version }}.tgz | awk '{ print $1 }')
echo "CHECKSUM=$checksum" >> $GITHUB_OUTPUT
- name: Append checksum and update version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "aws-aws-distro-opentelemetry-node-autoinstrumentation-${{ github.event.inputs.version }}.tgz ${{ steps.get_sha256.outputs.CHECKSUM }}" >> checksum.txt
echo "${{ github.event.inputs.version }}" > version.txt
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "GitHub Action Release Workflow"
git add checksum.txt version.txt
git commit -m "Update latest version and append checksum"
git push


25 changes: 2 additions & 23 deletions .github/workflows/release-lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
- name: NPM Clean Install
# https://docs.npmjs.com/cli/v10/commands/npm-ci
run: npm ci
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
aws lambda publish-layer-version \
--layer-name ${{ env.LAYER_NAME }} \
--content S3Bucket=${{ env.BUCKET_NAME }},S3Key=layer.zip \
--compatible-runtimes nodejs18.x nodejs20.x \
--compatible-runtimes nodejs18.x nodejs20.x nodejs22.x \
--compatible-architectures "arm64" "x86_64" \
--license-info "Apache-2.0" \
--description "AWS Distro of OpenTelemetry Lambda Layer for NodeJs Runtime" \
Expand Down Expand Up @@ -186,16 +186,6 @@ jobs:
with:
name: layer.tf
path: layer.tf
- name: Commit changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
mv layer.tf lambda-layer/terraform/lambda/
git add lambda-layer/terraform/lambda/layer.tf
git commit -m "Update Lambda layer ARNs for releasing" || echo "No changes to commit"
git push
create-release:
runs-on: ubuntu-latest
needs: generate-release-note
Expand All @@ -207,23 +197,12 @@ jobs:
echo "COMMIT_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)
echo "SHORT_SHA=${SHORT_SHA}" >> $GITHUB_ENV
- name: Create Tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
TAG_NAME="lambda-${SHORT_SHA}"
git tag -a "$TAG_NAME" -m "Release Lambda layer based on commit $TAG_NAME"
git push origin "$TAG_NAME"
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: "Release AWSOpenTelemetryDistroPython Lambda Layer"
body_path: lambda-layer/terraform/lambda/layer.tf
draft: true
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN npm install aws-aws-distro-opentelemetry-node-autoinstrumentation-$(node -p
RUN npm install

# Stage 2: Build the cp-utility binary
FROM public.ecr.aws/docker/library/rust:1.75 as builder
FROM public.ecr.aws/docker/library/rust:1.81 as builder

WORKDIR /usr/src/cp-utility
COPY ./tools/cp-utility .
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ This project ensures compatibility with the following supported NodeJS versions:
### Note on Amazon CloudWatch Application Signals

[Amazon CloudWatch Application Signals](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Monitoring-Sections.html) components are designed to seamlessly work with all library instrumentations offered by [OpenTelemetry NodeJS auto-instrumentation](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/metapackages/auto-instrumentations-node/README.md). While upstream OpenTelemetry NodeJS instrumentations are in beta, Application Signals components are stable, production ready and have also been tested for popular libraries/frameworks such as `ExpressJS, AWS SDK for JavaScript V3, and others`. We will prioritize backward compatibility for Application Signals components, striving to ensure that they remain functional even in the face of potential breaking changes introduced by OpenTelemetry upstream libraries. Please [raise an issue](https://github.com/aws-observability/aws-otel-js-instrumentation/blob/main/CONTRIBUTING.md#reporting-bugsfeature-requests) if you notice Application Signals doesn't work for a particular OpenTelemetry supported library.

## Checksum Verification

Artifacts released will include a `.sha256` file for checksum verification starting from v0.4.0
To verify, run the command `shasum -a 256 -c <artifact_name>.sha256`
It should return the output `<artifact_name>: OK` if the validation is successful
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
node_modules
.eslintrc.js
version.ts
version.ts
src/third-party
69 changes: 15 additions & 54 deletions aws-distro-opentelemetry-node-autoinstrumentation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws/aws-distro-opentelemetry-node-autoinstrumentation",
"version": "0.3.0-dev0",
"version": "0.4.0-dev0",
"description": "This package provides Amazon Web Services distribution of the OpenTelemetry Node Instrumentation, which allows for auto-instrumentation of NodeJS applications.",
"author": {
"name": "Amazon Web Services",
Expand Down Expand Up @@ -31,9 +31,18 @@
"prepublishOnly": "npm run compile",
"tdd": "yarn test -- --watch-extensions ts --watch",
"test": "nyc ts-mocha --timeout 10000 -p tsconfig.json --require '@opentelemetry/contrib-test-utils' 'test/**/*.ts'",
"test:coverage": "nyc --all --check-coverage --functions 95 --lines 95 ts-mocha --timeout 10000 -p tsconfig.json --require '@opentelemetry/contrib-test-utils' 'test/**/*.ts'",
"test:coverage": "nyc --check-coverage --functions 95 --lines 95 ts-mocha --timeout 10000 -p tsconfig.json --require '@opentelemetry/contrib-test-utils' 'test/**/*.ts'",
"watch": "tsc -w"
},
"nyc": {
"all": true,
"include": [
"src/**/*.ts"
],
"exclude": [
"src/third-party/**/*.ts"
]
},
"bugs": {
"url": "https://github.com/aws-observability/aws-otel-js-instrumentation/issues"
},
Expand Down Expand Up @@ -64,8 +73,11 @@
"@aws-sdk/client-bedrock-agent-runtime": "3.632.0",
"@aws-sdk/client-bedrock-runtime": "3.632.0",
"@aws-sdk/client-kinesis": "3.632.0",
"@aws-sdk/client-lambda": "^3.632.0",
"@aws-sdk/client-s3": "3.632.0",
"@aws-sdk/client-sqs": "3.632.0",
"@aws-sdk/client-secrets-manager": "^3.632.0",
"@aws-sdk/client-sfn": "^3.632.0",
"@aws-sdk/client-sns": "^3.632.0",
"@opentelemetry/contrib-test-utils": "0.41.0",
"@types/mocha": "7.0.2",
"@types/node": "18.6.5",
Expand Down Expand Up @@ -99,57 +111,6 @@
"@opentelemetry/sdk-trace-base": "1.26.0",
"@opentelemetry/semantic-conventions": "1.27.0"
},
"overrides": {
"@opentelemetry/auto-instrumentations-node": {
"@opentelemetry/instrumentation": "0.53.0",
"@opentelemetry/instrumentation-amqplib": "0.42.0",
"@opentelemetry/instrumentation-aws-lambda": "0.44.0",
"@opentelemetry/instrumentation-aws-sdk": "0.44.0",
"@opentelemetry/instrumentation-bunyan": "0.41.0",
"@opentelemetry/instrumentation-cassandra-driver": "0.41.0",
"@opentelemetry/instrumentation-connect": "0.39.0",
"@opentelemetry/instrumentation-cucumber": "0.9.0",
"@opentelemetry/instrumentation-dataloader": "0.12.0",
"@opentelemetry/instrumentation-dns": "0.39.0",
"@opentelemetry/instrumentation-express": "0.42.0",
"@opentelemetry/instrumentation-fastify": "0.39.0",
"@opentelemetry/instrumentation-fs": "0.15.0",
"@opentelemetry/instrumentation-generic-pool": "0.39.0",
"@opentelemetry/instrumentation-graphql": "0.43.0",
"@opentelemetry/instrumentation-grpc": "0.53.0",
"@opentelemetry/instrumentation-hapi": "0.41.0",
"@opentelemetry/instrumentation-http": "0.53.0",
"@opentelemetry/instrumentation-ioredis": "0.43.0",
"@opentelemetry/instrumentation-kafkajs": "0.3.0",
"@opentelemetry/instrumentation-knex": "0.40.0",
"@opentelemetry/instrumentation-koa": "0.43.0",
"@opentelemetry/instrumentation-lru-memoizer": "0.40.0",
"@opentelemetry/instrumentation-memcached": "0.39.0",
"@opentelemetry/instrumentation-mongodb": "0.47.0",
"@opentelemetry/instrumentation-mongoose": "0.42.0",
"@opentelemetry/instrumentation-mysql": "0.41.0",
"@opentelemetry/instrumentation-mysql2": "0.41.0",
"@opentelemetry/instrumentation-nestjs-core": "0.40.0",
"@opentelemetry/instrumentation-net": "0.39.0",
"@opentelemetry/instrumentation-pg": "0.44.0",
"@opentelemetry/instrumentation-pino": "0.42.0",
"@opentelemetry/instrumentation-redis": "0.42.0",
"@opentelemetry/instrumentation-redis-4": "0.42.0",
"@opentelemetry/instrumentation-restify": "0.41.0",
"@opentelemetry/instrumentation-router": "0.40.0",
"@opentelemetry/instrumentation-socket.io": "0.42.0",
"@opentelemetry/instrumentation-tedious": "0.14.0",
"@opentelemetry/instrumentation-undici": "0.6.0",
"@opentelemetry/instrumentation-winston": "0.40.0",
"@opentelemetry/resource-detector-alibaba-cloud": "0.29.1",
"@opentelemetry/resource-detector-aws": "1.6.1",
"@opentelemetry/resource-detector-azure": "0.2.11",
"@opentelemetry/resource-detector-container": "0.4.1",
"@opentelemetry/resource-detector-gcp": "0.29.11",
"@opentelemetry/resources": "1.26.0",
"@opentelemetry/sdk-node": "0.53.0"
}
},
"files": [
"build/src/**/*.js",
"build/src/**/*.js.map",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const AWS_ATTRIBUTE_KEYS: { [key: string]: string } = {
AWS_REMOTE_RESOURCE_IDENTIFIER: 'aws.remote.resource.identifier',
AWS_SDK_DESCENDANT: 'aws.sdk.descendant',
AWS_CONSUMER_PARENT_SPAN_KIND: 'aws.consumer.parent.span.kind',
AWS_CLOUDFORMATION_PRIMARY_IDENTIFIER: 'aws.remote.resource.cfn.primary.identifier',

AWS_REMOTE_TARGET: 'aws.remote.target',
AWS_REMOTE_DB_USER: 'aws.remote.db.user',
Expand All @@ -35,4 +36,12 @@ export const AWS_ATTRIBUTE_KEYS: { [key: string]: string } = {
AWS_BEDROCK_KNOWLEDGE_BASE_ID: 'aws.bedrock.knowledge_base.id',
AWS_BEDROCK_AGENT_ID: 'aws.bedrock.agent.id',
AWS_BEDROCK_GUARDRAIL_ID: 'aws.bedrock.guardrail.id',
AWS_BEDROCK_GUARDRAIL_ARN: 'aws.bedrock.guardrail.arn',
AWS_SNS_TOPIC_ARN: 'aws.sns.topic.arn',
AWS_SECRETSMANAGER_SECRET_ARN: 'aws.secretsmanager.secret.arn',
AWS_STEPFUNCTIONS_STATEMACHINE_ARN: 'aws.stepfunctions.state_machine.arn',
AWS_STEPFUNCTIONS_ACTIVITY_ARN: 'aws.stepfunctions.activity.arn',
AWS_LAMBDA_FUNCTION_NAME: 'aws.lambda.function.name',
AWS_LAMBDA_RESOURCE_MAPPING_ID: 'aws.lambda.resource_mapping.id',
AWS_LAMBDA_FUNCTION_ARN: 'aws.lambda.function.arn',
};
Loading

0 comments on commit 2228552

Please sign in to comment.