info

package
Version: v0.0.0-...-24d4c76 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   string
	GitCommit string
	GitBranch string
	BuildDate string
	GoVersion string
)

version info sourced from build flags

Functions

func CleanInfoExtraLines

func CleanInfoExtraLines(info string) string

CleanInfoExtraLines removes empty lines from template code indentation. The idea is that an indented empty line (only indentation spaces) is because of code indentation, so we remove it. Real legit empty lines contain no space.

func Info

func Info(w io.Writer, conf *config.AgentConfig) error

Info writes a standard info message describing the running agent. This is not the current program, but an already running program, which we query with an HTTP request.

If error is nil, means the program is running. If not, it displays a pretty-printed message anyway (for support)

func InitInfo

func InitInfo(conf *config.AgentConfig) error

InitInfo initializes the info structure. It should be called only once.

func Languages

func Languages() []string

Languages exposes languages reporting traces to the Agent.

func UpdateErrorsSamplerInfo

func UpdateErrorsSamplerInfo(ss SamplerInfo)

UpdateErrorsSamplerInfo updates internal stats about error sampling.

func UpdatePreSampler

func UpdatePreSampler(ss sampler.PreSamplerStats)

UpdatePreSampler updates internal stats about the pre-sampling.

func UpdatePrioritySamplerInfo

func UpdatePrioritySamplerInfo(ss SamplerInfo)

UpdatePrioritySamplerInfo updates internal stats about priority sampling.

func UpdateRateByService

func UpdateRateByService(rbs map[string]float64)

UpdateRateByService updates the RateByService map.

func UpdateReceiverStats

func UpdateReceiverStats(rs *ReceiverStats)

UpdateReceiverStats updates internal stats about the receiver.

func UpdateSamplerInfo

func UpdateSamplerInfo(ss SamplerInfo)

UpdateSamplerInfo updates internal stats about signature sampling.

func UpdateServiceWriterInfo

func UpdateServiceWriterInfo(sws ServiceWriterInfo)

UpdateServiceWriterInfo updates internal service writer stats

func UpdateStatsWriterInfo

func UpdateStatsWriterInfo(sws StatsWriterInfo)

UpdateStatsWriterInfo updates internal stats writer stats

func UpdateTraceWriterInfo

func UpdateTraceWriterInfo(tws TraceWriterInfo)

UpdateTraceWriterInfo updates internal trace writer stats

func UpdateWatchdogInfo

func UpdateWatchdogInfo(wi watchdog.Info)

UpdateWatchdogInfo updates internal stats about the watchdog.

func VersionString

func VersionString() string

VersionString returns the version information filled in at build time

Types

type EndpointStats

type EndpointStats struct {
	// TracesPayload is the number of traces payload sent, including errors.
	// If several URLs are given, each URL counts for one.
	TracesPayload int64
	// TracesPayloadError is the number of traces payload sent with an error.
	// If several URLs are given, each URL counts for one.
	TracesPayloadError int64
	// TracesBytes is the size of the traces payload data sent, including errors.
	// If several URLs are given, it does not change the size (shared for all).
	// This is the raw data, encoded, compressed.
	TracesBytes int64
	// TracesStats is the number of stats in the traces payload data sent, including errors.
	// If several URLs are given, it does not change the size (shared for all).
	TracesStats int64
	// TracesPayload is the number of services payload sent, including errors.
	// If several URLs are given, each URL counts for one.
	ServicesPayload int64
	// ServicesPayloadError is the number of services payload sent with an error.
	// If several URLs are given, each URL counts for one.
	ServicesPayloadError int64
	// TracesBytes is the size of the services payload data sent, including errors.
	// If several URLs are given, it does not change the size (shared for all).
	ServicesBytes int64
}

EndpointStats contains stats about the volume of data written

type ReceiverStats

type ReceiverStats struct {
	sync.RWMutex
	Stats map[Tags]*TagStats
}

ReceiverStats is used to store all the stats per tags.

func NewReceiverStats

func NewReceiverStats() *ReceiverStats

NewReceiverStats returns a new ReceiverStats

func (*ReceiverStats) Acc

func (rs *ReceiverStats) Acc(recent *ReceiverStats)

Acc accumulates the stats from another ReceiverStats struct.

func (*ReceiverStats) GetTagStats

func (rs *ReceiverStats) GetTagStats(tags Tags) *TagStats

GetTagStats returns the struct in which the stats will be stored depending of their tags.

func (*ReceiverStats) Languages

func (rs *ReceiverStats) Languages() []string

Languages returns the set of languages reporting traces to the Agent.

func (*ReceiverStats) Publish

func (rs *ReceiverStats) Publish()

Publish updates stats about per-tag stats

func (*ReceiverStats) Reset

func (rs *ReceiverStats) Reset()

Reset resets the ReceiverStats internal data

func (*ReceiverStats) Strings

func (rs *ReceiverStats) Strings() []string

Strings gives a multi strings representation of the ReceiverStats struct.

type SamplerInfo

type SamplerInfo struct {
	// Stats contains statistics about what the sampler is doing.
	Stats SamplerStats
	// State is the internal state of the sampler (for debugging mostly)
	State sampler.InternalState
}

SamplerInfo represents internal stats and state of a sampler

type SamplerStats

type SamplerStats struct {
	// KeptTPS is the number of traces kept (average per second for last flush)
	KeptTPS float64
	// TotalTPS is the total number of traces (average per second for last flush)
	TotalTPS float64
}

SamplerStats contains sampler statistics

type ServiceWriterInfo

type ServiceWriterInfo struct {
	Payloads int64
	Services int64
	Errors   int64
	Retries  int64
	Bytes    int64
}

ServiceWriterInfo represents statistics from the service writer.

type Stats

type Stats struct {
	// TracesReceived is the total number of traces received, including the dropped ones.
	TracesReceived int64
	// TracesDropped is the number of traces dropped.
	TracesDropped int64
	// TracesFiltered is the number of traces filtered.
	TracesFiltered int64
	// TracesPriorityNone is the number of traces with no sampling priority.
	TracesPriorityNone int64
	// TracesPriorityNeg is the number of traces with a negative sampling priority.
	TracesPriorityNeg int64
	// TracesPriority0 is the number of traces with sampling priority set to zero.
	TracesPriority0 int64
	// TracesPriority1 is the number of traces with sampling priority automatically set to 1.
	TracesPriority1 int64
	// TracesPriority2 is the number of traces with sampling priority manually set to 2 or more.
	TracesPriority2 int64
	// TracesBytes is the amount of data received on the traces endpoint (raw data, encoded, compressed).
	TracesBytes int64
	// SpansReceived is the total number of spans received, including the dropped ones.
	SpansReceived int64
	// SpansDropped is the number of spans dropped.
	SpansDropped int64
	// SpansFiltered is the number of spans filtered.
	SpansFiltered int64
	// ServicesReceived is the number of services received.
	ServicesReceived int64
	// ServicesBytes is the amount of data received on the services endpoint (raw data, encoded, compressed).
	ServicesBytes int64
}

Stats holds the metrics that will be reported every 10s by the agent. Its fields require to be accessed in an atomic way.

func (*Stats) String

func (s *Stats) String() string

String returns a string representation of the Stats struct

type StatsWriterInfo

type StatsWriterInfo struct {
	Payloads     int64
	StatsBuckets int64
	Errors       int64
	Retries      int64
	Splits       int64
	Bytes        int64
}

StatsWriterInfo represents statistics from the stats writer.

type StatusInfo

type StatusInfo struct {
	CmdLine  []string `json:"cmdline"`
	Pid      int      `json:"pid"`
	Uptime   int      `json:"uptime"`
	MemStats struct {
		Alloc uint64
	} `json:"memstats"`
	Version       infoVersion             `json:"version"`
	Receiver      []TagStats              `json:"receiver"`
	RateByService map[string]float64      `json:"ratebyservice"`
	TraceWriter   TraceWriterInfo         `json:"trace_writer"`
	StatsWriter   StatsWriterInfo         `json:"stats_writer"`
	ServiceWriter ServiceWriterInfo       `json:"service_writer"`
	Watchdog      watchdog.Info           `json:"watchdog"`
	PreSampler    sampler.PreSamplerStats `json:"presampler"`
	Config        config.AgentConfig      `json:"config"`
}

StatusInfo is what we use to parse expvar response. It does not need to contain all the fields, only those we need to display when called with `-info` as JSON unmarshaller will automatically ignore extra fields.

type TagStats

type TagStats struct {
	Tags
	Stats
}

TagStats is the struct used to associate the stats with their set of tags.

type Tags

type Tags struct {
	Lang, LangVersion, Interpreter, TracerVersion string
}

Tags holds the tags we parse when we handle the header of the payload.

type TraceWriterInfo

type TraceWriterInfo struct {
	Payloads       int64
	Traces         int64
	Transactions   int64
	Spans          int64
	Errors         int64
	Retries        int64
	Bytes          int64
	SingleMaxSpans int64
}

TraceWriterInfo represents statistics from the trace writer.

Jump to

Keyboard shortcuts

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