No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
test Adds recording of errors (responses with codes < 200 and >= 300) Feb 13, 2018

Zipkin instrumentation for vue-resource Build Status npm version


An interceptor for vue-resource that instruments outgoing HTTP requests with Zipkin.


Sometimes tracing of your backend components is not enough, so you need to do some tracing on frontend side (part of End User Monitoring). This package helps to solve that problem for VueJS with Zipkin.


... to install

npm install --save zipkin-instrumentation-vue-resource

... to add an interceptor

What you need to do is to initialise Zipkin Tracer, because the interceptor does not provide any default for that at the moment.

main.js may contain initialisation logic and may look like this:

// these imports are zipkin-specific
import {
} from 'zipkin'
import {HttpLogger} from 'zipkin-transport-http'
// and here the interceptor is imported
import {zipkinInterceptor} from 'zipkin-instrumentation-vue-resource'

const serviceName = 'myfancywebsite'

// this Tracer communicates to Zipkin through HTTP protocol
const tracer = new Tracer({
  ctxImpl: new ExplicitContext(),
  recorder: new BatchRecorder({
    logger: new HttpLogger({
      // take a look
      endpoint: window.location.protocol + '//' + + '/zipkin',
      jsonEncoder: jsonEncoder.JSON_V2
  localServiceName: serviceName

// and here is how the interceptor is created and added to vue-resource's chain
const interceptor = zipkinInterceptor({tracer, serviceName})

... to send data to Zipkin

Your application can communicate to Zipkin through HTTP, you can do that using Webpack's proxy table. proxyTable in config/index.js may look like this:

  proxyTable: {
      '/zipkin': {
      target: process.env.ZIPKIN_ADDRESS || '',
      pathRewrite: {
          '^/zipkin': ''
      secure: false

The piece of configuration above redirects all requests to /zipkin path (exactly what the interceptor uses in example above) to your actual Zipkin server running on