loggregator

package module
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2017 License: Apache-2.0 Imports: 5 Imported by: 89

README

go-loggregator slack.cloudfoundry.org

This is a golang client library for Loggregator.

Versions

At present, Loggregator supports two API versions: v1 (UDP) and v2 (gRPC). This library provides clients for both versions.

Note that this library is also versioned. Its versions have no relation to the Loggregator API. Presently, v2.0.0 is the most recent release.

Usage

This repository should be imported as:

import loggregator "code.cloudfoundry.org/go-loggregator"

Example

Example implementation of the client is provided in examples/main.go.

Build the example client by running go build -o client main.go

Collocate the client with a metron agent and set the following environment variables: CA_CERT_PATH, CERT_PATH, KEY_PATH

Documentation

Overview

loggregator provides a top-level client for connecting to the loggregator v1 and v2 API's.

All members in the package here are deprecated and will be removed in the next major version of this library. Instead, see the v1 and v2 packages for the preferred way of connecting to the respective loggregator API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client deprecated

type Client interface {
	SendDuration(name string, value time.Duration) error
	SendMebiBytes(name string, value int) error
	SendMetric(name string, value int) error
	SendBytesPerSecond(name string, value float64) error
	SendRequestsPerSecond(name string, value float64) error
	IncrementCounter(name string) error
	SendAppLog(appID, message, sourceType, sourceInstance string) error
	SendAppErrorLog(appID, message, sourceType, sourceInstance string) error
	SendAppMetrics(metrics *events.ContainerMetric) error
}

Client is the shared contract between v1 and v2 clients.

Deprecated: This interface will be removed in the next major version. Instead, use the v1 or v2 clients directly.

func NewClient deprecated

func NewClient(config Config) (Client, error)

NewClient returns a v1 or v2 client depending on the value of `UseV2API` from the config

Deprecated: NewClient will be removed in the next major version. Instead, create a v1 or v2 client directly.

func NewV1Client deprecated

func NewV1Client(config Config) (Client, error)

NewV1Client creates a V1 connection to the Loggregator API.

Deprecated: NewV1Client will be removed in the next major version. Instead, use v1.NewClient.

func NewV2Client deprecated

func NewV2Client(config Config) (Client, error)

NewV2Client creates a V2 connection to the Loggregator API.

Deprecated: NewV2Client will be removed in the next major version. Instead, use v2.NewClient.

type Config deprecated

type Config struct {
	UseV2API      bool   `json:"loggregator_use_v2_api"`
	APIPort       int    `json:"loggregator_api_port"`
	CACertPath    string `json:"loggregator_ca_path"`
	CertPath      string `json:"loggregator_cert_path"`
	KeyPath       string `json:"loggregator_key_path"`
	JobDeployment string `json:"loggregator_job_deployment"`
	JobName       string `json:"loggregator_job_name"`
	JobIndex      string `json:"loggregator_job_index"`
	JobIP         string `json:"loggregator_job_ip"`
	JobOrigin     string `json:"loggregator_job_origin"`

	BatchMaxSize       uint
	BatchFlushInterval time.Duration
}

Config is the shared configuration between v1 and v2 clients.

Deprecated: Config will be removed in the next major version. Instead, create a v1 or v2 client directly.

Directories

Path Synopsis
examples
Code generated by counterfeiter.
Code generated by counterfeiter.
internal
loggregator_v2
Package loggregator_v2 is a generated protocol buffer package.
Package loggregator_v2 is a generated protocol buffer package.
v1 provides a client to connect with the loggregtor v1 API Loggregator's v1 client library is better known to the Cloud Foundry community as Dropsonde (github.com/cloudfoundry/dropsonde).
v1 provides a client to connect with the loggregtor v1 API Loggregator's v1 client library is better known to the Cloud Foundry community as Dropsonde (github.com/cloudfoundry/dropsonde).
Package v2 provides a client to send data to the Loggregator v2 API.
Package v2 provides a client to send data to the Loggregator v2 API.

Jump to

Keyboard shortcuts

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