Advanced
Advanced configuration
Configuration Methods
You can pass a configuration options object when initializing Aspecto in code, like this for example:
Or add configuration file named aspecto.json
near your package.json
with the same options as above:
Or use various environment variables, for example:
Values are evaluated in the following priority:
options
objectenvironment variables
config file
default values
Configuration Options
Available install configurations (all are optional):
Option | Environment Variable | Type | Default | Description |
|
| boolean |
| Disable aspecto |
|
| string |
| Set environment name manually |
|
| UUID | Set Aspecto token from code instead of using | |
|
| string | "name" in | Set serviceName manually instead of reading it from |
|
| string | "version" in | Set serviceVersion manually instead of reading it from |
|
| number |
| How many of the traces starting in this service should be sampled. Set to number in range [0.0, 1.0] where |
|
| boolean |
| When |
| - | logger interface | Logger to be used in this tracing library. Common use for debugging | |
|
| boolean |
| Should Aspecto SDK collect payloads of operations |
|
| string |
| Target URL to which the OTLP http exporter is going to send spans |
|
| number |
| How many spans to batch in a single export to the collector |
|
| number |
| Maximum time in ms for batching spans before sending to collector |
| - | boolean |
| If |
| - | URL | Send all traces to additional Zipkin server for debug | |
|
| boolean |
| For aws-sdk instrumentation. Should be true when the service receiveMessages from SQS which is subscribed to SNS and subscription configured with "Raw message delivery": Disabled. Setting to |
|
| boolean |
| Set to |
|
| boolean |
| Set to |
|
| boolean |
| Set to |
Advanced Settings
Exporting Format
Data collected by the SDK is sent to Aspecto's collector in protobuf format by default.
An alternative is to send the data in JSON format, which uses less CPU for encoding the message but is more verbose - causing more data to be sent over the network.
To export data over JSON instead of protobuf, set the environment variable ASPECTO_TRACE_EXPORT_JSON
to any value.
Disabling Aspecto
Set the environment variable DISABLE_ASPECTO
to any value, to disable Aspecto.
Affect lambda and GCF wrappers as well.
Useful when running unit tests, or as a simple kill switch.
Last updated