honeycombmarkerexporter

package module
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 21 Imported by: 1

README

Honeycomb Marker Exporter

Status
Stability alpha: logs
Distributions contrib
Issues Open issues Closed issues
Code Owners @TylerHelmuth, @fchikwekwe

This exporter allows creating markers, via the Honeycomb Markers API, based on the look of incoming telemetry.

The following configuration options are supported:

  • api_key (Required): This is the API key for your Honeycomb account.
  • api_url (Optional): This sets the hostname to send marker data to. If not set, will default to https://api.honeycomb.io/
  • markers (Required): This is a list of configurations to create an event marker.
    • type (Required): Specifies the marker type.
    • rules (Required): This is a list of OTTL rules that determine when to create an event marker.
      • log_conditions (Required): A list of OTTL log conditions that determine a match. The marker will be created if ANY condition matches.
    • dataset_slug (Optional): The dataset in which to create the marker. If not set, will default to __all__.
    • message_key (Optional): The key of the attribute whose value will be used as the marker's message. If necessary the value will be converted to a string.
    • url_key (Optional): The key of the attribute whose value will be used as the marker's url. If necessary the value will be converted to a string.

Example:

exporters:
  honeycombmarker:
    api_key: {{env:HONEYCOMB_API_KEY}}
    markers:
      # Creates a new marker anytime the exporter sees a k8s event with a reason of Backoff
      - type: k8s-backoff-events
        rules:
          log_conditions:
            - IsMap(body) and IsMap(body["object"]) and body["object"]["reason"] == "Backoff"

Documentation

Overview

Package honeycombmarkerexporter exports Marker data to Honeycomb.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() exporter.Factory

Types

type Config

type Config struct {
	// APIKey is the authentication token associated with the Honeycomb account.
	APIKey configopaque.String `mapstructure:"api_key"`

	// API URL to use (defaults to https://api.honeycomb.io)
	APIURL string `mapstructure:"api_url"`

	// Markers is the list of markers to create
	Markers []Marker `mapstructure:"markers"`

	confighttp.ClientConfig      `mapstructure:",squash"`
	exporterhelper.QueueSettings `mapstructure:"sending_queue"`
	configretry.BackOffConfig    `mapstructure:"retry_on_failure"`
}

Config defines configuration for the Honeycomb Marker exporter.

func (*Config) Validate

func (cfg *Config) Validate() error

type Marker

type Marker struct {
	// Type defines the type of Marker.
	Type string `mapstructure:"type"`

	// MessageKey is the attribute that will be used as the message.
	// If necessary the value will be converted to a string.
	MessageKey string `mapstructure:"message_key"`

	// URLKey is the attribute that will be used as the url.
	// If necessary the value will be converted to a string.
	URLKey string `mapstructure:"url_key"`

	// Rules are the OTTL rules that determine when a piece of telemetry should be turned into a Marker
	Rules Rules `mapstructure:"rules"`

	// DatasetSlug is the endpoint that specifies the Honeycomb environment
	DatasetSlug string `mapstructure:"dataset_slug"`
}

type Rules

type Rules struct {
	// LogConditions is the list of ottllog conditions that determine a match
	LogConditions []string `mapstructure:"log_conditions"`
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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