Categorygithub.com/signalfx/go-loggregator
modulepackage
6.2.0+incompatible
Repository: https://github.com/signalfx/go-loggregator.git
Documentation: pkg.go.dev

# README

go-loggregator

GoDoc travis 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.

Usage

This repository should be imported as:

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

Examples

To build the examples, cd into the directory of the example and run go build

V1 Ingress

Emits envelopes to metron using dropsonde.

V2 Ingress

Emits envelopes to metron using the V2 loggregator-api.

Required Environment Variables:

  • CA_CERT_PATH
  • CERT_PATH
  • KEY_PATH

Runtime Stats

Emits information about the running Go proccess using a V2 ingress client.

Required Environment Variables:

  • CA_CERT_PATH
  • CERT_PATH
  • KEY_PATH

Envelope Stream Connector

Reads envelopes from the Loggregator API (e.g. Reverse Log Proxy).

Required Environment Variables:

  • CA_CERT_PATH
  • CERT_PATH
  • KEY_PATH
  • LOGS_API_ADDR
  • SHARD_ID

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
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).

# Functions

NewEgressTLSConfig provides a convenient means for creating a *tls.Config which uses the CA, cert, and key for the egress endpoint.
NewEnvelopeStreamConnector creates a new EnvelopeStreamConnector.
NewIngressClient creates a v2 loggregator client.
NewIngressTLSConfig provides a convenient means for creating a *tls.Config which uses the CA, cert, and key for the ingress endpoint.
NewOneToOneEnvelopeBatch initializes a new one to one diode for envelope batches of a given size and alerter.
WithAddr allows for the configuration of the loggregator v2 address.
WithAppInfo configures the meta data associated with emitted data.
WithBatchFlushInterval allows for the configuration of the maximum time to wait before sending a batch of messages.
WithBatchMaxSize allows for the configuration of the number of messages to collect before emitting them into loggregator.
WithCounterAppInfo configures an envelope with both the app ID and index.
WithCounterSourceInfo configures an envelope with both the app ID and source ID.
WithDelta is an option that sets the delta for a counter.
WithEnvelopeStreamBuffer enables the EnvelopeStream to read more quickly from the stream.
WithEnvelopeStreamLogger allows for the configuration of a logger.
WithEnvelopeTag adds a tag to the envelope.
WithEnvelopeTags adds tag information that can be text, integer, or decimal to the envelope.
WithGaugeAppInfo configures an envelope with both the app ID and index.
WithGaugeSourceInfo configures an envelope with both the source ID and instance ID.
WithGaugeValue adds a gauge information.
WithLogger allows for the configuration of a logger.
WithSourceInfo configures the meta data associated with emitted data.
WithStdout sets the output type to stdout.
WithTag allows for the configuration of arbitrary string value metadata which will be included in all data sent to Loggregator.
WithTimerSourceInfo configures an envelope with both the source and instance IDs.

# Structs

EnvelopeStreamConnector provides a way to connect to loggregator and consume a stream of envelopes.
IngressClient represents an emitter into loggregator.
OneToOneEnvelopeBatch diode is optimized for a single writer and a single reader.

# Interfaces

Logger declares the minimal logging interface used within the v2 client.

# Type aliases

EmitCounterOption is the option type passed into EmitCounter.
EmitEventOption is the option type passed into EmitEvent.
EmitGaugeOption is the option type passed into EmitGauge.
EmitLogOption is the option type passed into EmitLog.
EmitTimerOption is the option type passed into EmitTimer.
EnvelopeStream returns batches of envelopes.
EnvelopeStreamOption configures a EnvelopeStreamConnector.
IngressOption is the type of a configurable client option.