Skip to content
Branch: master
Find file History
icebob Publish
 - moleculer-console-tracer@0.2.1
 - moleculer-jaeger@0.2.1
 - moleculer-prometheus@0.2.1
 - moleculer-zipkin@0.2.1
Latest commit ffffc31 Mar 29, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
examples add api GW to examples Mar 25, 2018
src
test/unit fix: jaeger/zipkin add tags null/undefined value Mar 28, 2019
.gitignore
CHANGELOG.md update changelog Jul 10, 2018
LICENSE add jaeger files Mar 9, 2018
README.md
index.js
package-lock.json
package.json

README.md

Moleculer logo

moleculer-jaeger NPM version

Moleculer metrics module for Jaeger.

Jaeger screenshot

Features

  • 5 types sampler
  • UDP sender

Install

$ npm install moleculer-jaeger

Usage

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

// services/metrics.jaeger.service.js
const JaegerService = require("moleculer-jaeger");

module.exports = {
    mixins: [JaegerService],
    settings: {
        host: "jaeger-server",
        port: 6832
    }
};

Sampler configurations

More info: http://jaeger.readthedocs.io/en/latest/client_libraries/#sampling

Setup ConstSampler (default):

module.exports = {
    mixins: [JaegerService],
    settings: {
        host: "jaeger-server",
        port: 6832,
        
        sampler: {
            type: "Const",
            options: {
                decision: 1
            }
        }
    }
});

Setup RateLimitingSampler:

module.exports = {
    mixins: [JaegerService],
    settings: {
        host: "jaeger-server",
        port: 6832,
        
        sampler: {
            type: "RateLimiting",
            options: {
                maxTracesPerSecond: 2,
                initBalance: 5
            }
        }
    }
});

Setup ProbabilisticSampler:

module.exports = {
    mixins: [JaegerService],
    settings: {
        host: "jaeger-server",
        port: 6832,
        
        sampler: {
            type: "Probabilistic",
            options: {
                samplingRate: 0.1 // 10%
            }
        }
    }
});

Setup GuaranteedThroughputSampler:

GuaranteedThroughputProbabilisticSampler is a sampler that leverages both probabilisticSampler and rateLimitingSampler. The rateLimitingSampler is used as a guaranteed lower bound sampler such that every operation is sampled at least once in a time interval defined by the lowerBound. ie a lowerBound of 1.0 / (60 * 10) will sample an operation at least once every 10 minutes.

module.exports = {
    mixins: [JaegerService],
    settings: {
        host: "jaeger-server",
        port: 6832,
        
        sampler: {
            type: "GuaranteedThroughput",
            options: {
                lowerBound: 0.1,
                samplingRate: 0.1
            }
        }
    }
});

Setup RemoteControlledSampler:

module.exports = {
    mixins: [JaegerService],
    settings: {
        host: "jaeger-server",
        port: 6832,
        
        sampler: {
            type: "RemoteControlled",
            options: {
                //...
            }
        }
    }
});

Settings

Property Type Default Description
host String required UDP Sender host option.
port Number null UDP Sender port option.
sampler Object null Sampler configuration.
sampler.type String null Sampler type
sampler.options any required
options Object null Additional options for Jaeger.Tracer

Actions

Methods

Test

$ npm test

In development with watching

$ npm run ci

License

The project is available under the MIT license.

Contact

Copyright (c) 2016-2018 MoleculerJS

@moleculerjs @MoleculerJS

You can’t perform that action at this time.