OpenTelemetry Agent - JavaScript on Linux Installation
Installation Wizard
To help with the installation process, vFunction offers an Installation Wizard. This Wizard provides additional information about the Prerequisites as well as steps for deploying the OpenTelemetry Agent to your environment.
Please contact support@vfunction.com or your vFunction Contact(s) for the password to start using this Wizard.
Installation Steps
- Install the OpenTelemetry JavaScript Packages
npm install --save @opentelemetry/api
npm install --save @opentelemetry/auto-instrumentations-node
- Run the JavaScript Application with OpenTelemetry Environment Variables
- Find-and-replace $SERVICE_NAME with the name of the Service for the Application
- Find-and-replace $PROTOCOL with http or https based on the VF Server configuration
- Find-and-replace $VF_SERVER_ADDRESS with the URL for your organization’s vFunction Server
- Find-and-replace $VF_APP_ID with the Application UUID created with the Installation Instructions from the vFunction Server UI
- Find-and-replace $APP_NAME with the name of the JavaScript script
export OTEL_SERVICE_NAME="$MY_SERVICE"
export OTEL_EXPORTER_OTLP_ENDPOINT="http://$VF_SERVER_ADDRESS/api/unauth/otlp"
export OTEL_EXPORTER_OTLP_HEADERS="$VF_APP_ID"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_TRACES_EXPORTER="otlp"
export OTEL_LOGS_EXPORTER="none"
export NODE_OPTIONS="--require @opentelemetry/auto-instrumentations-node/register"
node $APP_NAME.js