Coralogix Processor
Description
The Coralogix processor adds attributes to spans that enable features in Coralogix.
Features
DB Statement Blueprints
This feature enables the processor to create blueprints from SQL queries, this means replacing any variables with ?
.
The blueprint is also hashed to be able to be used with the spanmetrics connector.
Long queries can be an issue when being stored in certain metric stores.
Blueprints alleviate this problem by using the hash as the identifying dimension on the metric, which enables
users to query metrics by blueprints.
The added attributes are db.statement.blueprint
and db.statement.blueprint.id
.
db.statement.blueprint
contains the blueprinted version of the statement, we require them to be sent to Coralogix to
display your blueprinted statement
db.statement.blueprint.id
contains a hash of the statement, this way we can add it as a dimension in the spanmetrics
connector and use it to query your blueprints.
sampling.priority
if enabled contains the value 100 for new blueprints, further explanation below.
Sampling
If sampling is enabled then it stores the found blueprints in an in-memory cache to be able to send only new blueprints
that haven't been seen yet.
This only adds an attribute to the span named sampling.priority
, if the blueprint is new then the sampling priority
will be 100
.
Using this key it's possible to use either
the Tail Sampler
or
the Probabilistic Sampler
to only send new blueprints to Coralogix.
If sampling is not enabled it won't cache anything and the sampling.priority
attribute won't be added.
The cache is limited by the max_cache_size_mib
configuration, if the cache is full it will remove the oldest entries
to make space for new ones.
The cache stores hashes of the queries, each hash is 8 bytes, so the number of maximum cache entries is calculated
by max_cache_size_mib * 1024 * 1024 / 8
.
Config
db_statement_blueprints
sampling
:
enabled
: (default: false
) If enabled, adds the attribute sampling.priority
with a value of 100
to spans with new
blueprints.
Refer to the Sampling section for more information.
max_cache_size_mib
(default: 1024
) The size of the cache in mebibytes to store seen blueprints hashes.
Basic Setup
This setup is without sampling meaning no sampling.priority
attribute will be added to spans.
The cache will be disabled.
processors:
coralogix:
db_statement_blueprints:
With Sampling Config
This setup will enable the cache to store seen blueprints and add the sampling.priority
attribute to spans with new
blueprints.
processors:
coralogix:
db_statement_blueprints:
sampling:
enabled: true
max_cache_size_mib: 1024 #1GiB