OpenTelemetry Restify Instrumentation allows the user to automatically collect trace data and export them to the backend of choice (we can use Zipkin or Jaeger for this example). This example demonstrates tracing calls made to Restify API. All generated spans include following attributes:
http.route
: resolved route;restify.method
: server method used to register the handler. One ofuse
,pre
,del
,get
,head
,opts
,post
,put
orpatch
;restify.type
: eithermiddleware
orrequest_handler
;restify.version
:restify
version running.
Setup Zipkin Tracing or Setup Jaeger Tracing
First install the dependencies:
npm install
npm run zipkin:server # Run the server
npm run zipkin:client # Run the client in a separate terminal
npm run jaeger:server # Run the server
npm run jaeger:client # Run the client in a separate terminal
- For more information on OpenTelemetry, visit: https://opentelemetry.io/
- For more information on OpenTelemetry for Node.js, visit: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node
Apache License 2.0