coralogixprocessor

package module
v0.120.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

README

Coralogix Processor

Status
Stability development: traces
Distributions []
Warnings Statefulness
Issues Open issues Closed issues
Code Owners @crobert-1, @povilasv

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() processor.Factory

NewFactory returns a new factory for the Span processor.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func (*Config) Validate

func (c *Config) Validate() error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL