kibana

package module
v0.0.0-...-7e41e0a Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: GPL-3.0 Imports: 12 Imported by: 1

README

go-kibana

The unofficial Go client for Kibana

Documentation

Index

Constants

View Source
const (
	Version = "0.1.0"
)

Default values for client configuration

Variables

This section is empty.

Functions

func NewOpenTelemetryInstrumentation

func NewOpenTelemetryInstrumentation(provider trace.TracerProvider, captureBody bool) elastictransport.Instrumentation

NewOpenTelemetryInstrumentation provides the OpenTelemetry integration for Kibana client

Types

type Client

type Client struct {
	Transport elastictransport.Interface
	//
	// API clients
	*kbapi.API
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg Config) (*Client, error)

NewClient creates a new Kibana client

func (*Client) InstrumentationEnabled

func (c *Client) InstrumentationEnabled() elastictransport.Instrumentation

InstrumentationEnabled propagates back to the client the Instrumentation provided by the transport.

func (*Client) Metrics

func (c *Client) Metrics() (elastictransport.Metrics, error)

Metrics returns the client metrics.

func (*Client) Perform

func (c *Client) Perform(req *http.Request) (*http.Response, error)

Perform delegates to Transport to execute a request and return a response.

type Config

type Config struct {
	Addresses       []string    // A list of Kibana instances to use.
	Username        string      // Username for HTTP Basic Authentication.
	Password        string      // Password for HTTP Basic Authentication.
	APIKey          string      // Base64-encoded token for authorization; if set, overrides username/password and service token.
	Header          http.Header // Global HTTP request header.
	XSRFHeaderValue string      // Value for the kbn-xsrf header; defaults to "true" if not set.

	// PEM-encoded certificate authorities.
	// When set, an empty certificate pool will be created, and the certificates will be appended to it.
	// The option is only valid when the transport is not specified, or when it's http.Transport.
	CACert []byte

	RetryOnStatus []int                           // List of status codes for retry. Default: 502, 503, 504.
	DisableRetry  bool                            // Default: false.
	MaxRetries    int                             // Default: 3.
	RetryOnError  func(*http.Request, error) bool // Optional function allowing to indicate which error should be retried. Default: nil.

	EnableMetrics     bool // Enable the metrics collection.
	EnableDebugLogger bool // Enable the debug logging.

	RetryBackoff func(attempt int) time.Duration // Optional backoff duration. Default: nil.

	// Logger for client operations
	Transport http.RoundTripper         // The HTTP transport object.
	Logger    elastictransport.Logger   // The logger object.
	Selector  elastictransport.Selector // The selector object.

	Instrumentation elastictransport.Instrumentation // Enable instrumentation throughout the client.
}

Config represents the client configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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