qrynexporter

package
v0.0.0-...-e2edb79 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

README

qryn Exporter

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

Configuration options:

  • dsn (required): Clickhouse's dsn.
  • clustered_clickhouse (required): true if clickhouse cluster is used

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

Types

type Config

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

	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 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 Trace

type Trace 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"`
}

Trace represent trace model

Jump to

Keyboard shortcuts

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