-
Notifications
You must be signed in to change notification settings - Fork 539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Update deprecations in instrumentation-express/examples #1842
chore: Update deprecations in instrumentation-express/examples #1842
Conversation
This must have moved into contrib a while back
Without this, 'npm install' now depends on directories higher than this one. It does not create a node_modules and then ts-node does not work. Looks like the use of workspaces at the repository root interferes with this example, but this change to the install command gets around that.
Jaeger accepts OTLP now, so the OtlpTraceExporter just works
aaab655
to
992be7b
Compare
😢 I can't fix "npm ci" at the top level of this project, that isn't me |
@jessitron I can try to help sort out updating deps so that Starting with your latest changes, I found I was getting this error from npm when trying to run
I didn't dive in to try to figure out what that was about. Instead I started over with the examples/package.json from "main" and roughly did the following: npm ci # run this at the top-dir to install everything
cd plugins/node/opentelemetry-instrumentation-express/examples
npm uninstall @opentelemetry/instrumentation-express
npm install @opentelemetry/[email protected]
npm install @opentelemetry/resources
npm install @opentelemetry/sdk-trace-base @opentelemetry/sdk-trace-node @opentelemetry/semantic-conventions
npm install @opentelemetry/exporter-jaeger @opentelemetry/exporter-zipkin
npm install @opentelemetry/exporter-trace-otlp-proto Note that I'm working towards using npm workspaces, and not using the |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1842 +/- ##
=======================================
Coverage 91.51% 91.51%
=======================================
Files 145 145
Lines 7427 7427
Branches 1486 1486
=======================================
Hits 6797 6797
Misses 630 630 |
Here are a few attempts of my steps to get the express example built and working with a fresh git clone. attempt 0I didn't actually play with and try to get the attempt 1Getting example working with a full build of all packages in the repo. This # Get a build of the Express example and its dependencies.
git clone [email protected]:open-telemetry/opentelemetry-js-contrib.git
cd opentelemetry-js-contrib
npm ci
npm run compile
cd plugins/node/opentelemetry-instrumentation-express/examples
npm run compile
# Start an Zipkin to use viewing traces.
docker run --name example-zipkin --rm -d -p 9411:9411 openzipkin/zipkin
# Run the express server, configured to export to Zipkin.
npm run zipkin:server
# In a separate terminal, run the client that calls the express server.
npm run zipkin:client Visit the Zipkin UI to search for spans for the client requests. When finished then clean up:
attempt 2 (requires a patch)I was able to reduce the build time, somewhat by trying to install (via git clone [email protected]:open-telemetry/opentelemetry-js-contrib.git
cd opentelemetry-js-contrib/plugins/node/opentelemetry-instrumentation-express
npm ci
npm run compile
cd examples
npm ci
npm run compile However, that requires this patch to work: diff --git a/plugins/node/opentelemetry-instrumentation-express/package.json b/plugins/node/opentelemetry-instrumentation-express/package.json
index 91065940..edfb4477 100644
--- a/plugins/node/opentelemetry-instrumentation-express/package.json
+++ b/plugins/node/opentelemetry-instrumentation-express/package.json
@@ -12,7 +12,7 @@
"clean": "rimraf build/*",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
- "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-express --include-dependencies",
+ "precompile": "tsc --version && npm run version:update",
"prewatch": "npm run precompile",
"version:update": "node ../../../scripts/version-update.js",
"compile": "tsc -p .", and I'm not yet sure of the implications of doing this in general. Doing this probably should be done on a separate PR that looks at doing it generally for all the packages in this repo. attempt 3This installs all deps at the top-level (
What do you think about documenting these steps in the README? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this much-needed update!
I understand the frustrations around working with a monorepo. Perhaps we can document both workspaces=false
for a simple local build and also one of Trent's suggestions around getting the true dependencies working with workspaces. I can add that as a follow-up PR.
Hm looks like the updated merge from main failed some status checks, think we should be able to run |
Not entirely sure why but I'm unable to push to this PR from my local env. |
…, why I am not sure)
Hopefully that should do it. I pulled your earlier merge, sync'd the package-lock.json file ( |
plugins/node/opentelemetry-instrumentation-express/examples/package.json
Show resolved
Hide resolved
I also had to manually remove this (vestigial?) entry in package-lock.json that was breaking 'npm install'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming tests pass, I'm happy with this now.
Signed-off-by: Jamie Danielson <[email protected]>
Which problem is this PR solving?
Short description of the changes