qrynexporter

package
v0.0.0-...-7afc304 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

README

qryn Exporter

Status
Stability [alpha]
Supported pipeline types traces, logs, metrics
Distributions [qryn]

Configuration options:

  • dsn (required): Data Source Name for Clickhouse.

    • Example: tcp://localhost:9000/qryn
  • clustered_clickhouse (required):

    • Type: boolean
    • Description: Set to true if using a Clickhouse cluster; otherwise, set to false.
  • client_side_trace_processing (required):

    • Type: boolean
    • Default: true
    • Description: Enables client-side processing of trace data. This can improve performance but may increase client-side resource usage.

Example:

Simple Trace Data

receivers:
  examplereceiver:

exporters:
  qryn:
    dsn: tcp://localhost:9000/?database=cloki
    clustered_clickhouse: false

service:
  pipelines:
    traces:
      receivers: [examplereceiver]
      exporters: [qryn]

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	TimeSerieSQL = func(clustered bool) string {
		dist := ""
		if clustered {
			dist = "_dist"
		}
		return fmt.Sprintf(`INSERT INTO time_series%s (
  date, 
  fingerprint,
  labels,
  name)`, dist)
	}
)

Functions

func NewFactory

func NewFactory() exporter.Factory

NewFactory creates a factory for Logging exporter

func TracesTagsV2InputSQL

func TracesTagsV2InputSQL(clustered bool) string

func TracesV2InputSQL

func TracesV2InputSQL(clustered bool) string

Types

type Config

type Config struct {
	exporterhelper.TimeoutSettings `mapstructure:",squash"`
	configretry.BackOffConfig      `mapstructure:"retry_on_failure"`
	exporterhelper.QueueSettings   `mapstructure:"sending_queue"`

	// ClientSideTraceProcessing is a boolean that indicates whether to process traces on the client side.
	ClientSideTraceProcessing bool `mapstructure:"client_side_trace_processing"`

	ClusteredClickhouse bool `mapstructure:"clustered_clickhouse"`

	// DSN is the ClickHouse server Data Source Name.
	// For tcp protocol reference: [ClickHouse/clickhouse-go#dsn](https://github.com/ClickHouse/clickhouse-go#dsn).
	// For http protocol reference: [mailru/go-clickhouse/#dsn](https://github.com/mailru/go-clickhouse/#dsn).
	DSN string `mapstructure:"dsn"`

	// Logs is used to configure the log data.
	Logs LogsConfig `mapstructure:"logs"`
	// Metrics is used to configure the metric data.
	Metrics MetricsConfig `mapstructure:"metrics"`
}

Config defines configuration for logging exporter.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks if the exporter configuration is valid

type LogsConfig

type LogsConfig struct {
	// AttributeLabels is the string representing attribute labels.
	AttributeLabels string `mapstructure:"attribute_labels"`
	// ResourceLabels is the string representing resource labels.
	ResourceLabels string `mapstructure:"resource_labels"`
	// Format is the string representing the format.
	Format string `mapstructure:"format"`
}

LogsConfig holds the configuration for log data.

type MetricsConfig

type MetricsConfig struct {
	// Namespace is the prefix attached to each exported metric name.
	// See: https://prometheus.io/docs/practices/naming/#metric-names
	Namespace string `mapstructure:"namespace"`
}

MetricsConfig holds the configuration for metric data.

type Sample

type Sample struct {
	Fingerprint uint64  `ch:"fingerprint"`
	TimestampNs int64   `ch:"timestamp_ns"`
	Value       float64 `ch:"value"`
	String      string  `ch:"string"`
}

Sample represent sample data `CREATE TABLE IF NOT EXISTS samples_v3 (

fingerprint UInt64,
timestamp_ns Int64 CODEC(DoubleDelta),
value Float64 CODEC(Gorilla),
string String

) ENGINE = MergeTree PARTITION BY toStartOfDay(toDateTime(timestamp_ns / 1000000000)) ORDER BY ({{SAMPLES_ORDER_RUL}})`

type TempoTrace

type TempoTrace struct {
	OID         string `ch:"oid"`
	TraceID     []byte `ch:"trace_id"`
	SpanID      []byte `ch:"span_id"`
	ParentID    []byte `ch:"parent_id"`
	Name        string `ch:"name"`
	TimestampNs int64  `ch:"timestamp_ns"`
	DurationNs  int64  `ch:"duration_ns"`
	ServiceName string `ch:"service_name"`
	PayloadType int8   `ch:"payload_type"`
	Payload     string `ch:"payload"`
}

type TempoTraceTag

type TempoTraceTag struct {
	OID         string    `ch:"oid"`
	Date        time.Time `ch:"date"`
	Key         string    `ch:"key"`
	Val         string    `ch:"val"`
	TraceID     []byte    `ch:"trace_id"`
	SpanID      []byte    `ch:"span_id"`
	TimestampNs int64     `ch:"timestamp_ns"`
	DurationNs  int64     `ch:"duration"`
}

type TimeSerie

type TimeSerie struct {
	Date        time.Time `ch:"date"`
	Fingerprint uint64    `ch:"fingerprint"`
	Labels      string    `ch:"labels"`
	Name        string    `ch:"name"`
}

TimeSerie represent TimeSerie `CREATE TABLE IF NOT EXISTS time_series (

date Date,
fingerprint UInt64,
labels String,
name String

) ENGINE = ReplacingMergeTree(date) PARTITION BY date ORDER BY fingerprint

type TraceInput

type TraceInput struct {
	TraceID     string     `ch:"trace_id"`
	SpanID      string     `ch:"span_id"`
	ParentID    string     `ch:"parent_id"`
	Name        string     `ch:"name"`
	TimestampNs int64      `ch:"timestamp_ns"`
	DurationNs  int64      `ch:"duration_ns"`
	ServiceName string     `ch:"service_name"`
	PayloadType int8       `ch:"payload_type"`
	Payload     string     `ch:"payload"`
	Tags        [][]string `ch:"tags"`
}

TraceInput represent trace model

Jump to

Keyboard shortcuts

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