sqliteexporter

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 21 Imported by: 0

README

sqliteexporter

Sqlite exporter for the OpenTelemetry Collector and OpenTelemetry Go.

Note that this is an alpha release, tables and column names may change in the future. golang-migrate is used to manage updates to the database schema.

Configuration Options

  • path [no default]: Path to the Sqlite database file. If the file does not exist, it will be created on startup.

Example

exporters:
  sqlite:
    path: local.db

Tables

Currently, this exporter creates 3 tables to store trace span data:

  • spans: Each individual spans
  • events: Span events, with a span_id to JOIN with the spans table
  • links: Span links, with a parent_span_id to JOIN with the spans table

The Resource and Instrumentation Library are inlined in the spans table. This creates some duplication but makes the schema much easier to navigate and query. Attributes are inlined as JSON-encoded string and can be queried using Sqlite's JSON functions and operators.

Note on JSONB data type

Sqlite recently added support for the JSONB data type which improves performance on JSON-encoded data. Support for this feature is planned for the future.

Documentation

Overview

Copyright 2024 William Perron. All rights reserved. MIT License.

Package sqliteexporter exports data to sqlite.

Copyright 2024 William Perron. All rights reserved. MIT License.

Copyright 2024 William Perron. All rights reserved. MIT License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() exporter.Factory

func NewSqliteSDKTraceExporter

func NewSqliteSDKTraceExporter(cfg *Config) (sdktrace.SpanExporter, error)

func NewSqliteSDKTraceExporterWithDB

func NewSqliteSDKTraceExporterWithDB(db *sql.DB) (sdktrace.SpanExporter, error)

Types

type Config

type Config struct {
	// Path of the sqlite3 database file. Path is relative to current directory.
	// If file does not exist, it will be created by the exporter.
	Path string `mapstructure:"path"`
}

func (*Config) Unmarshal

func (cfg *Config) Unmarshal(componentParser *confmap.Conf) error

func (*Config) Validate

func (cfg *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