README

diego-logging-client

The Diego Logging Client provides a generic client for Diego to Cloud Foundry's logging subsystem, Loggregator.

The client wraps the go-loggregator library to provide a tailored interface for Diego components.

Reporting issues and requesting features

Please report all issues and feature requests in cloudfoundry/diego-release.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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"`
	SourceID      string `json:"loggregator_source_id"`
	InstanceID    string `json:"loggregator_instance_id"`

	BatchMaxSize       uint `json:"loggregator_batch_max_size"`
	BatchFlushInterval time.Duration
}

    Config is the shared configuration between v1 and v2 clients.

    type ContainerMetric

    type ContainerMetric struct {
    	ApplicationId          string //deprecated
    	InstanceIndex          int32  //deprecated
    	CpuPercentage          float64
    	MemoryBytes            uint64
    	DiskBytes              uint64
    	MemoryBytesQuota       uint64
    	DiskBytesQuota         uint64
    	AbsoluteCPUUsage       uint64
    	AbsoluteCPUEntitlement uint64
    	ContainerAge           uint64
    	Tags                   map[string]string
    }

      A ContainerMetric records resource usage of an app in a container.

      type IngressClient

      type IngressClient interface {
      	SendDuration(name string, value time.Duration, opts ...loggregator.EmitGaugeOption) error
      	SendMebiBytes(name string, value int, opts ...loggregator.EmitGaugeOption) error
      	SendMetric(name string, value int, opts ...loggregator.EmitGaugeOption) error
      	SendBytesPerSecond(name string, value float64) error
      	SendRequestsPerSecond(name string, value float64) error
      	IncrementCounter(name string) error
      	IncrementCounterWithDelta(name string, value uint64) error
      	SendAppLog(message, sourceType string, tags map[string]string) error
      	SendAppErrorLog(message, sourceType string, tags map[string]string) error
      	SendAppMetrics(metrics ContainerMetric) error
      	SendSpikeMetrics(metrics SpikeMetric) error
      	SendComponentMetric(name string, value float64, unit string) error
      }

        IngressClient is the shared contract between v1 and v2 clients.

        func NewIngressClient

        func NewIngressClient(config Config) (IngressClient, error)

          NewIngressClient returns a v2 client if the config.UseV2API is true, or a no op client.

          func WrapClient

          func WrapClient(c logClient, s, i string) IngressClient

          type SpikeMetric

          type SpikeMetric struct {
          	Start time.Time
          	End   time.Time
          	Tags  map[string]string
          }

          Directories

          Path Synopsis
          Code generated by counterfeiter.
          Code generated by counterfeiter.