@hypertrace/nodejsagent v1.9.1
Node.js Agent
nodejsagent provides a set of complementary instrumentation features for collecting relevant data to be processed by Hypertrace.
Development
Building
- Update protobuf definitions
- Update the
agent-configsubmodule.git submodule update --init --recursive - Generate protobbuf files:
./src/instrumentation/config/generated.jsand./src/instrumentation/config.generated.d.ts.npm run generate_pb
- Update the
- Build.
npm run build
You can then install the generated .tgz as a normal dependency.
Note: Using npm link doesnt solve the local testing problem as it will use the hypertrace package dev-dependencies during instrumentation instead of the targetted node app
Testing
Run the example application
cd ./examples/correlation- Update
config.yamlif needed. - Install dependencies
npm install - Start application
npm start
Unit tests
- Start external services
cd ./test/externalServices docker-compose up -d cd - npm run testStop external services if not needed.
``` cd ./test/externalServices docker-compose down cd - ```Tests should be added to the
testdirectory, in a structure that matches that of the file you are attempting to test.Ideally all functionality is testable in locally runnable unit-tests(as opposed to in a docker container), primarily for ease of debugging.
- Start external services
Lambda layer
To build the layer & upload it to an AWS account:
- Build using the steps above.
- Run
./build_layer.sh <REGION>where region is the region you want the layer to be available in - Add an environment variable to your lambda:
AWS_LAMBDA_EXEC_WRAPPER=/opt/hypertrace-instrument - Configure reporting to a collector, you can set
HT_REPORTING_ENDPOINTto a valid OTLP collector address. - If using with a collector layer, no need to specify an OTLP address as it will export to localhost:4317
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago