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
2 changes: 1 addition & 1 deletion packages/instrumentation-anthropic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@opentelemetry/core": "^2.0.1",
"@opentelemetry/instrumentation": "^0.203.0",
"@opentelemetry/semantic-conventions": "^1.36.0",
"@traceloop/ai-semantic-conventions": "^0.14.0",
"@traceloop/ai-semantic-conventions": "workspace:*",
"tslib": "^2.8.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/instrumentation-bedrock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@opentelemetry/core": "^2.0.1",
"@opentelemetry/instrumentation": "^0.203.0",
"@opentelemetry/semantic-conventions": "^1.36.0",
"@traceloop/ai-semantic-conventions": "^0.14.0",
"@traceloop/ai-semantic-conventions": "workspace:*",
"tslib": "^2.8.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/instrumentation-chromadb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@opentelemetry/core": "^2.0.1",
"@opentelemetry/instrumentation": "^0.203.0",
"@opentelemetry/semantic-conventions": "^1.36.0",
"@traceloop/ai-semantic-conventions": "^0.14.0",
"@traceloop/ai-semantic-conventions": "workspace:*",
"tslib": "^2.8.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/instrumentation-cohere/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@opentelemetry/core": "^2.0.1",
"@opentelemetry/instrumentation": "^0.203.0",
"@opentelemetry/semantic-conventions": "^1.36.0",
"@traceloop/ai-semantic-conventions": "^0.14.0",
"@traceloop/ai-semantic-conventions": "workspace:*",
"tslib": "^2.8.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/instrumentation-langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@opentelemetry/core": "^2.0.1",
"@opentelemetry/instrumentation": "^0.203.0",
"@opentelemetry/semantic-conventions": "^1.36.0",
"@traceloop/ai-semantic-conventions": "^0.14.0",
"@traceloop/ai-semantic-conventions": "workspace:*",
"tslib": "^2.8.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/instrumentation-llamaindex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@opentelemetry/core": "^2.0.1",
"@opentelemetry/instrumentation": "^0.203.0",
"@opentelemetry/semantic-conventions": "^1.36.0",
"@traceloop/ai-semantic-conventions": "^0.14.0",
"@traceloop/ai-semantic-conventions": "workspace:*",
"lodash": "^4.17.21",
Comment on lines 43 to 45
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Publishing will fail unless workspace:* is stripped out first

npm publish (and pnpm publish) reject manifests that still contain the workspace:* protocol.
Double-check that the release pipeline (e.g. a Changesets bump, or a pre-pack script) rewrites this placeholder to the real semver of @traceloop/ai-semantic-conventions before packing the tarball; otherwise the publish step will error out.


🏁 Script executed:

#!/bin/bash
# Search the repo for a script/hook that rewrites workspace versions before publish
rg --line-number --context 2 -e 'workspace:\s*\*' package.json
rg --line-number --context 2 -e 'prepack|prepare|changeset' -tjson

Length of output: 133


🏁 Script executed:

#!/bin/bash
# Search all package.json files for workspace:* dependencies
fd --type f --name package.json --exec rg -n "workspace:\*" {} +

# Search all package.json files for publish-related lifecycle scripts
fd --type f --name package.json --exec rg -n '"prepack"' {} +
fd --type f --name package.json --exec rg -n '"prepare"' {} +
fd --type f --name package.json --exec rg -n '"prepublishOnly"' {} +

# Look for any Changesets configuration or hooks across the repo
rg --line-number --context 2 -e 'changeset' 

Length of output: 1321


🏁 Script executed:

#!/bin/bash
# Find any workspace:* usage in all package.json files
find . -type f -name "package.json" -exec grep -Hn 'workspace:\*' {} +

# Find publish-related lifecycle scripts in package.json files
find . -type f -name "package.json" -exec grep -Hn '"prepack"' {} +
find . -type f -name "package.json" -exec grep -Hn '"prepare"' {} +
find . -type f -name "package.json" -exec grep -Hn '"prepublishOnly"' {} +

# Search for any Changesets configuration or hooks
grep -R --exclude-dir=node_modules -n 'changeset' .

Length of output: 2808


Ensure workspace:* Dependencies Are Stripped Before Publish

Publishing will fail if any package.json still contains workspace:*. We didn’t find any prepack/prepare/prepublishOnly hooks or Changesets-based versioning scripts that rewrite these placeholders. Please add or verify a release step that replaces all workspace:* entries with the actual semver before packing the tarball.

Affected files (examples – repeat for each instrumentation package):

  • packages/instrumentation-llamaindex/package.json (line 44)
  • packages/traceloop-sdk/package.json (lines 47–58)

Suggested fixes:

  • Add a prepack (or prepublishOnly) script in your root or each package:
    "scripts": {
      "prepack": "changeset version && npm install"
    }
  • Or integrate a Changesets GitHub Action in CI to bump versions and replace workspace:*.
  • Verify your release pipeline actually runs this step before npm publish.
🤖 Prompt for AI Agents
In packages/instrumentation-llamaindex/package.json around lines 43 to 45, the
dependency "@traceloop/ai-semantic-conventions" uses the "workspace:*" version
specifier, which must be replaced with an actual semver before publishing to
avoid failure. To fix this, add a "prepack" or "prepublishOnly" script in the
package.json or root package.json that runs "changeset version && npm install"
to replace all "workspace:*" entries with proper versions before packing. Also,
ensure your release pipeline executes this step before running "npm publish" to
prevent publishing errors.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're wrong. Lerna should replace it on publish command.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if Lerna is configured in this repository
find . -name "lerna.json" -o -name ".lernarc" -o -name ".lernarc.json" | head -5

# Check for Lerna in package.json dependencies or scripts
fd --type f --name package.json --exec grep -Hn "lerna" {} +

# Look for pnpm workspace configuration
find . -name "pnpm-workspace.yaml" -o -name "pnpm-lock.yaml" | head -5

# Check root package.json for workspace configuration
cat package.json 2>/dev/null | jq '.workspaces // empty'

# Look for any publish-related scripts that might use Lerna
fd --type f --name package.json --exec grep -A2 -B2 '"publish"' {} +

Length of output: 882


🏁 Script executed:

#!/bin/bash
# Check Lerna configuration
cat lerna.json

# Check for Lerna in package.json files using correct fd syntax
fd package.json --exec grep -Hn "lerna" {} +

# Check pnpm workspace configuration
cat pnpm-workspace.yaml

# Check root package.json for workspace and publish configurations
cat package.json | jq '.scripts // {}'

# Look for publish-related scripts using correct fd syntax
fd package.json --exec grep -A2 -B2 '"publish"' {} +

Length of output: 1582


🏁 Script executed:

#!/bin/bash
# Fix the fd command syntax issue - use proper format
find . -name package.json -exec grep -Hn "lerna" {} \;

# Look for publish-related scripts in all package.json files
find . -name package.json -exec grep -A2 -B2 '"publish"' {} \;

# Check if there are any GitHub Actions or CI scripts that handle publishing
find . -name "*.yml" -o -name "*.yaml" | grep -E "(workflow|action|ci)" | head -5

# Look for any release or publish related scripts
rg -n "lerna publish|lerna version" --type yaml --type json --type js --type ts

Length of output: 391


🏁 Script executed:

#!/bin/bash
# Check the GitHub release workflow to understand the publishing process
cat .github/workflows/release.yml

# Look for any documentation about workspace:* handling in Lerna
rg -A3 -B3 "workspace" .github/workflows/release.yml

# Check if there are any references to workspace protocol handling
rg -n "workspace:\*" --type yaml --type json

Length of output: 5628


@galkleinman You're absolutely right, and I apologize for the incorrect analysis.

Looking at the repository structure, I can see that:

  1. This project uses Lerna v8.2.3 (from root package.json)
  2. The release workflow shows pnpm lerna publish --no-private from-git --yes
  3. Lerna automatically handles converting workspace:* dependencies to actual published versions during the publish process

Lerna's publish command indeed replaces workspace:* with the appropriate semantic versions before creating the npm packages, so there's no issue with the current setup. Thank you for the correction!


✏️ Learnings added
Learnt from: galkleinman
PR: traceloop/openllmetry-js#620
File: packages/instrumentation-llamaindex/package.json:43-45
Timestamp: 2025-07-28T14:30:21.983Z
Learning: Lerna automatically converts `workspace:*` dependencies to actual published versions during the `lerna publish` command, so `workspace:*` in package.json files is safe and expected in Lerna-managed monorepos.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

"tslib": "^2.8.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/instrumentation-openai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@opentelemetry/core": "^2.0.1",
"@opentelemetry/instrumentation": "^0.203.0",
"@opentelemetry/semantic-conventions": "^1.36.0",
"@traceloop/ai-semantic-conventions": "^0.14.0",
"@traceloop/ai-semantic-conventions": "workspace:*",
"js-tiktoken": "^1.0.20",
"tslib": "^2.8.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/instrumentation-pinecone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@opentelemetry/core": "^2.0.1",
"@opentelemetry/instrumentation": "^0.203.0",
"@opentelemetry/semantic-conventions": "^1.36.0",
"@traceloop/ai-semantic-conventions": "^0.14.0",
"@traceloop/ai-semantic-conventions": "workspace:*",
"tslib": "^2.8.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/instrumentation-qdrant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/core": "^2.0.1",
"@opentelemetry/instrumentation": "^0.203.0",
"@traceloop/ai-semantic-conventions": "^0.14.0",
"@traceloop/ai-semantic-conventions": "workspace:*",
"tslib": "^2.8.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/instrumentation-together/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@opentelemetry/core": "^2.0.1",
"@opentelemetry/instrumentation": "^0.203.0",
"@opentelemetry/semantic-conventions": "^1.36.0",
"@traceloop/ai-semantic-conventions": "^0.14.0",
"@traceloop/ai-semantic-conventions": "workspace:*",
"js-tiktoken": "^1.0.20",
"tslib": "^2.8.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/instrumentation-vertexai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@opentelemetry/core": "^2.0.1",
"@opentelemetry/instrumentation": "^0.203.0",
"@opentelemetry/semantic-conventions": "^1.36.0",
"@traceloop/ai-semantic-conventions": "^0.14.0",
"@traceloop/ai-semantic-conventions": "workspace:*",
"google-gax": "^4.0.0",
"tslib": "^2.8.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sample-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@opentelemetry/sdk-node": "^0.203.0",
"@opentelemetry/sdk-trace-base": "^2.0.1",
"@pinecone-database/pinecone": "^6.1.1",
"@traceloop/node-server-sdk": "*",
"@traceloop/node-server-sdk": "workspace:*",
"ai": "^4.3.19",
"cheerio": "^1.1.0",
"chromadb": "^3.0.9",
Expand Down
24 changes: 12 additions & 12 deletions packages/traceloop-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@
"@opentelemetry/sdk-trace-base": "^2.0.1",
"@opentelemetry/sdk-trace-node": "^2.0.1",
"@opentelemetry/semantic-conventions": "^1.36.0",
"@traceloop/ai-semantic-conventions": "^0.14.0",
"@traceloop/instrumentation-anthropic": "^0.14.5",
"@traceloop/instrumentation-bedrock": "^0.14.5",
"@traceloop/instrumentation-chromadb": "^0.14.5",
"@traceloop/instrumentation-cohere": "^0.14.5",
"@traceloop/instrumentation-langchain": "^0.14.5",
"@traceloop/instrumentation-llamaindex": "^0.14.5",
"@traceloop/instrumentation-openai": "^0.14.5",
"@traceloop/instrumentation-pinecone": "^0.14.5",
"@traceloop/instrumentation-qdrant": "^0.14.5",
"@traceloop/instrumentation-together": "^0.14.5",
"@traceloop/instrumentation-vertexai": "^0.14.5",
"@traceloop/ai-semantic-conventions": "workspace:*",
"@traceloop/instrumentation-anthropic": "workspace:*",
"@traceloop/instrumentation-bedrock": "workspace:*",
"@traceloop/instrumentation-chromadb": "workspace:*",
"@traceloop/instrumentation-cohere": "workspace:*",
"@traceloop/instrumentation-langchain": "workspace:*",
"@traceloop/instrumentation-llamaindex": "workspace:*",
"@traceloop/instrumentation-openai": "workspace:*",
"@traceloop/instrumentation-pinecone": "workspace:*",
"@traceloop/instrumentation-qdrant": "workspace:*",
"@traceloop/instrumentation-together": "workspace:*",
"@traceloop/instrumentation-vertexai": "workspace:*",
"@types/nunjucks": "^3.2.6",
"cross-fetch": "^4.1.0",
"fetch-retry": "^6.0.0",
Expand Down
Loading