Aspecto Sampler
You can craft your own custom installation of OpenTelemetry NodeJS SDK and integrate Aspecto Sampler to benefit from advanced sampling capabilities.
Aspecto sampler fetches remote sampling rules that you configure in Aspecto platform and applies them on traces that start in a given service.
Install
npm
yarn
Usage
Create an instance of AspectoSampler
and use it in your TracerProvider
Configuration
You can configure the sampler via one or more of the following:
options
variable. for example:new AspectoSampler({optionName: optionValue})
. This enables setting config options dynamically.Environment variables
Add
aspecto.json
configuration file to the root directory, next to service'spackage.json
file
Values are evaluated in the following priority:
options
objectenvironment variables
config file
default values
Aspecto auth is required. Service name and env are recommended.
Option Name | Environment Variable | Type | Default | Description |
---|---|---|---|---|
|
| boolean |
| Disable the sampler and don't apply any sampling logic (sample nothing) |
|
| UUID | - | |
|
| string | - | Set environment for matching sampling rules |
|
| string | - | Set service name for matching sampling rules |
|
| number |
| This option is used as a fallback if no specific sampling rule is matched, and before remote sampling rule configuration is fetched. It controls how many of the traces starting in this service should be sampled. Set to number in range the [0.0, 1.0] where |
|
| boolean |
| When |
Last updated