3.2.0 • Published 1 year ago

@fastify/zipkin v3.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@fastify/zipkin

CI NPM version js-standard-style

Fastify plugin for Zipkin distributed tracing system.

Install

npm i @fastify/zipkin

Usage

Require the plugin and register it within Fastify, then pass the following options: { serviceName, httpReporterUrl [, servicePort , tracer, recorder ] }

const fastify = require('fastify')()

fastify.register(require('@fastify/zipkin'), {
  serviceName: 'my-service-name',
  servicePort: 3000,
  httpReporterUrl: 'http://localhost:9411/api/v2/spans'
})

fastify.get('/', (req, reply) => {
  reply.send({ hello: 'world' })
})

fastify.listen({ port: 3000 }, err => {
  if (err) throw err
  console.log('Server listenting on localhost:', fastify.server.address().port)
})

License

Licensed under MIT.