Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including moleculer-zipkin with all npm packages installed. Try it out:

require("moleculer/package.json"); // moleculer is a peer dependency. var moleculerZipkin = require("moleculer-zipkin")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

moleculer-zipkin v0.2.1

Moleculer metrics module for Zipkin.

Moleculer logo

moleculer-zipkin NPM version

Moleculer metrics module for Zipkin.

Zipkin screenshot

Features

  • support v1 & v2 API.
  • send spans via HTTP.
  • batch or single sending.

Install

$ npm install moleculer-zipkin

Usage

// services/metrics.zipkin.service.js

const ZipkinService = require("moleculer-zipkin");

module.exports = {
    mixins: [ZipkinService],
    settings: {
        baseURL: "http://192.168.0.181:9411",
        version: "v2",
        batchTime: 1000,
        payloadOptions: {
            debug: false,
            shared: false
        }
    }
};

// moleculer.config.js
module.exports = {
    // ...
    metrics: true,
    // ...
}

Settings

| Property | Type | Default | Description | | -------- | ---- | ------- | ----------- | | `baseURL` | `String` | **required** | Base URL for Zipkin server. | | `version` | `String` | **required** | Zipkin REST API version. | | `batchTime` | `Number` | **required** | Batch send time interal. Disable: 0 | | `payloadOptions` | `Object` | **required** | Additional payload options. | | `payloadOptions.debug` | `Boolean` | **required** | Set `debug` property in v2 payload. | | `payloadOptions.shared` | `Boolean` | **required** | Set `shared` property in v2 payload. |
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free