agent

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLog

func SetLog(entty *logrus.Entry)

func SetLogger

func SetLogger(nLogger *logrus.Logger)

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

func CreateAgent

func CreateAgent(cnf Configuration) (*Agent, error)

func NewAgent

func NewAgent() (*Agent, error)

func (*Agent) AddToES

func (agent *Agent) AddToES(data ElasticData) error

func (*Agent) Close

func (agent *Agent) Close(w http.ResponseWriter, req *http.Request)

func (*Agent) InitES

func (agent *Agent) InitES() error

func (*Agent) Log

func (agent *Agent) Log(w http.ResponseWriter, req *http.Request)

func (*Agent) Meter

func (agent *Agent) Meter(w http.ResponseWriter, req *http.Request)

func (*Agent) Shutdown

func (agent *Agent) Shutdown()

func (*Agent) Trace

func (agent *Agent) Trace(w http.ResponseWriter, req *http.Request)

type Configuration

type Configuration struct {
	Port int //the port of this service

	IgnoreElastic bool //skip elastic validation only for testing..

	ZipkinEndpoint string //zipkin endpoint

	Endpoint string // the vdc endpoint
	VDCName  string // VDCName (used for the index name in elastic serach)

	ElasticSearchURL string //eleasticSerach endpoint

	ElasticBasicAuth bool //if active we use basic auth
	ElasticUser      string
	ElasticPassword  string
	// contains filtered or unexported fields
}

type ElasticData

type ElasticData struct {
	Timestamp time.Time     `json:"@timestamp"`
	Meter     *MeterMessage `json:"meter,omitempty"`
	Log       *LogMessage   `json:"log,omitempty"`
}

type LogMessage

type LogMessage struct {
	Timestamp time.Time `json:"timestamp,omitempty"`
	Value     string    `json:"value,omitempty"`
}

type MeterMessage

type MeterMessage struct {
	Timestamp   time.Time   `json:"timestamp,omitempty"`
	OperationID string      `json:"operationID,omitempty"`
	Value       interface{} `json:"value,omitempty"`
	Unit        string      `json:"unit,omitempty"`
	Name        string      `json:"name,omitempty"`
	Raw         string      `json:"appendix,omitempty"`
}

type TraceMessage

type TraceMessage struct {
	TraceId      string `json:"traceId"`
	ParentSpanId string `json:"parentSpanId"`
	SpanId       string `json:"spanId"`
	Operation    string `json:"operation"`
	Message      string `json:"message"`
}

Jump to

Keyboard shortcuts

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