Skip to content

Commit 7d365a4

Browse files
Bingtagui404nx-plugin-for-aws
andauthored
chore(ts#strands-agent/mcp-server): include ADOT in update-versions (#482)
Add @aws/aws-distro-opentelemetry-node-autoinstrumentation to TS_VERSIONS and replace hardcoded version in Dockerfile templates with a template variable rendered from the centralized version map. This ensures the ADOT Node.js package version is managed alongside other dependencies in the update-versions workflow, consistent with how Python ADOT is already handled. * fix(ts#strands-agent/mcp-server): pin ADOT version to 0.9.0 Pin @aws/aws-distro-opentelemetry-node-autoinstrumentation to exact version 0.9.0 instead of caret range ^0.7.0, consistent with how other dependencies in TS_VERSIONS use pinned versions. --------- Co-authored-by: nx-plugin-for-aws <nx-plugin@amazon.com>
1 parent f0df007 commit 7d365a4

6 files changed

Lines changed: 14 additions & 5 deletions

File tree

packages/nx-plugin/src/ts/mcp-server/files/Dockerfile.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /app
44

55
# Add AWS Distro for OpenTelemetry for observability
66
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability-configure.html
7-
RUN npm install @aws/aws-distro-opentelemetry-node-autoinstrumentation@^0.7.0
7+
RUN npm install @aws/aws-distro-opentelemetry-node-autoinstrumentation@<%- adotVersion %>
88

99
# Copy bundled streamable http server
1010
COPY --from=workspace <%- distDir %>/bundle/mcp/<%- name %>/index.js /app

packages/nx-plugin/src/ts/mcp-server/generator.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
} from '../../utils/nx';
2626
import { addGeneratorMetricsIfApplicable } from '../../utils/metrics';
2727
import { formatFilesInSubtree } from '../../utils/format';
28-
import { withVersions } from '../../utils/versions';
28+
import { TS_VERSIONS, withVersions } from '../../utils/versions';
2929
import { kebabCase, toClassName } from '../../utils/names';
3030
import { sharedConstructsGenerator } from '../../utils/shared-constructs';
3131
import { addMcpServerInfra } from '../../utils/agent-core-constructs/agent-core-constructs';
@@ -101,6 +101,10 @@ export const tsMcpServerGenerator = async (
101101
name,
102102
esm,
103103
distDir,
104+
adotVersion:
105+
TS_VERSIONS[
106+
'@aws/aws-distro-opentelemetry-node-autoinstrumentation'
107+
],
104108
},
105109
{ overwriteStrategy: OverwriteStrategy.KeepExisting },
106110
);

packages/nx-plugin/src/ts/strands-agent/__snapshots__/generator.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ WORKDIR /app
77
88
# Add AWS Distro for OpenTelemetry for observability
99
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability-configure.html
10-
RUN npm install @aws/aws-distro-opentelemetry-node-autoinstrumentation@^0.7.0
10+
RUN npm install @aws/aws-distro-opentelemetry-node-autoinstrumentation@0.9.0
1111
1212
# Copy bundled agent
1313
COPY --from=workspace dist/apps/test-project/bundle/agent/snapshot-bedrock-agent/index.js /app

packages/nx-plugin/src/ts/strands-agent/files/deploy/Dockerfile.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /app
44

55
# Add AWS Distro for OpenTelemetry for observability
66
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability-configure.html
7-
RUN npm install @aws/aws-distro-opentelemetry-node-autoinstrumentation@^0.7.0
7+
RUN npm install @aws/aws-distro-opentelemetry-node-autoinstrumentation@<%- adotVersion %>
88

99
# Copy bundled agent
1010
COPY --from=workspace <%- distDir %>/bundle/agent/<%- name %>/index.js /app

packages/nx-plugin/src/ts/strands-agent/generator.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
import { addGeneratorMetricsIfApplicable } from '../../utils/metrics';
2424
import { formatFilesInSubtree } from '../../utils/format';
2525
import { kebabCase, toClassName } from '../../utils/names';
26-
import { withVersions } from '../../utils/versions';
26+
import { TS_VERSIONS, withVersions } from '../../utils/versions';
2727
import { getNpmScope } from '../../utils/npm-scope';
2828
import { addTypeScriptBundleTarget } from '../../utils/bundle/bundle';
2929
import { resolveIacProvider } from '../../utils/iac';
@@ -93,6 +93,10 @@ export const tsStrandsAgentGenerator = async (
9393
{
9494
distDir,
9595
name,
96+
adotVersion:
97+
TS_VERSIONS[
98+
'@aws/aws-distro-opentelemetry-node-autoinstrumentation'
99+
],
96100
},
97101
{ overwriteStrategy: OverwriteStrategy.KeepExisting },
98102
);

packages/nx-plugin/src/utils/versions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Versons for TypeScript dependencies added by generators
88
*/
99
export const TS_VERSIONS = {
10+
'@aws/aws-distro-opentelemetry-node-autoinstrumentation': '0.9.0',
1011
'@aws-sdk/client-dynamodb': '3.1004.0',
1112
'@aws-sdk/client-sts': '3.1004.0',
1213
'@aws-sdk/credential-providers': '3.1004.0',

0 commit comments

Comments
 (0)