Documentation ¶
Index ¶
- Variables
- func CleanInfoExtraLines(info string) string
- func Info(w io.Writer, conf *config.AgentConfig) error
- func InitInfo(conf *config.AgentConfig) error
- func Languages() []string
- func UpdateErrorsSamplerInfo(ss SamplerInfo)
- func UpdatePrioritySamplerInfo(ss SamplerInfo)
- func UpdateRateByService(rbs map[string]float64)
- func UpdateRateLimiter(ss RateLimiterStats)
- func UpdateReceiverStats(rs *ReceiverStats)
- func UpdateSamplerInfo(ss SamplerInfo)
- func UpdateStatsWriterInfo(sws StatsWriterInfo)
- func UpdateTraceWriterInfo(tws TraceWriterInfo)
- func UpdateWatchdogInfo(wi watchdog.Info)
- func VersionString() string
- type EndpointStats
- type RateLimiterStats
- type ReceiverStats
- type SamplerInfo
- type SamplerStats
- type SpansMalformed
- type Stats
- type StatsWriterInfo
- type StatusInfo
- type TagStats
- type Tags
- type TraceWriterInfo
- type TracesDropped
Constants ¶
This section is empty.
Variables ¶
var ( Version string GitCommit string GitBranch string BuildDate string GoVersion string )
version info sourced from build flags
Functions ¶
func CleanInfoExtraLines ¶
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 UpdatePrioritySamplerInfo ¶
func UpdatePrioritySamplerInfo(ss SamplerInfo)
UpdatePrioritySamplerInfo updates internal stats about priority sampling.
func UpdateRateByService ¶
UpdateRateByService updates the RateByService map.
func UpdateRateLimiter ¶
func UpdateRateLimiter(ss RateLimiterStats)
UpdateRateLimiter updates internal stats about the rate limiting.
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 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 ¶
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 }
EndpointStats contains stats about the volume of data written
type RateLimiterStats ¶
type RateLimiterStats struct { // TargetRate is the rate limiting rate that we are aiming for. TargetRate float64 // RecentPayloadsSeen is the number of payloads that passed by. RecentPayloadsSeen float64 // RecentTracesSeen is the number of traces that passed by. RecentTracesSeen float64 // RecentTracesDropped is the number of traces that were dropped. RecentTracesDropped float64 }
RateLimiterStats contains rate limiting data. The public content might be interesting for statistics, logging.
type ReceiverStats ¶
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) LogStats ¶
func (rs *ReceiverStats) LogStats()
LogStats logs one-line summaries of ReceiverStats. Problematic stats are logged as warnings.
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
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 SpansMalformed ¶
type SpansMalformed struct { // DuplicateSpanID is when one or more spans in a trace have the same SpanId DuplicateSpanID int64 // ServiceEmpty is when a span has an empty Service field ServiceEmpty int64 // ServiceTruncate is when a span's Service is truncated for exceeding the max length ServiceTruncate int64 // ServiceInvalid is when a span's Service doesn't conform to Datadog tag naming standards ServiceInvalid int64 // SpanNameEmpty is when a span's Name is empty SpanNameEmpty int64 // SpanNameTruncate is when a span's Name is truncated for exceeding the max length SpanNameTruncate int64 // SpanNameInvalid is when a span's Name doesn't conform to Datadog tag naming standards SpanNameInvalid int64 // ResourceEmpty is when a span's Resource is empty ResourceEmpty int64 // TypeTruncate is when a span's Type is truncated for exceeding the max length TypeTruncate int64 // InvalidStartDate is when a span's Start date is invalid InvalidStartDate int64 // InvalidDuration is when a span's Duration is invalid InvalidDuration int64 // InvalidHTTPStatusCode is when a span's metadata contains an invalid http status code InvalidHTTPStatusCode int64 }
SpansMalformed contains counts for reasons malformed spans have been accepted after applying automatic fixes
func (*SpansMalformed) String ¶
func (s *SpansMalformed) String() string
type Stats ¶
type Stats struct { // TracesReceived is the total number of traces received, including the dropped ones. TracesReceived int64 // TracesDropped contains stats about the count of dropped traces by reason TracesDropped *TracesDropped // SpansMalformed contains stats about the count of malformed traces by reason SpansMalformed *SpansMalformed // 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 // EventsExtracted is the total number of APM events extracted from traces. EventsExtracted int64 // EventsSampled is the total number of APM events sampled. EventsSampled int64 // PayloadAccepted counts the number of payloads that have been accepted by the HTTP handler. PayloadAccepted int64 // PayloadRefused counts the number of payloads that have been rejected by the rate limiter. PayloadRefused int64 }
Stats holds the metrics that will be reported every 10s by the agent. Its fields require to be accessed in an atomic way.
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"` Watchdog watchdog.Info `json:"watchdog"` RateLimiter RateLimiterStats `json:"ratelimiter"` 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 ¶
TagStats is the struct used to associate the stats with their set of tags.
func (*TagStats) WarnString ¶
WarnString returns a string representation of the Stats struct containing only issues which we should be warning on if there are no issues then an empty string is returned
type Tags ¶
type Tags struct {
Lang, LangVersion, LangVendor, 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 Events int64 Spans int64 Errors int64 Retries int64 Bytes int64 BytesUncompressed int64 BytesEstimated int64 SingleMaxSize int64 }
TraceWriterInfo represents statistics from the trace writer.
type TracesDropped ¶
type TracesDropped struct { // DecodingError is when the agent fails to decode a trace payload DecodingError int64 // PayloadTooLarge specifies the number of traces dropped due to the payload // being too large to be accepted. PayloadTooLarge int64 // EmptyTrace is when the trace contains no spans EmptyTrace int64 // TraceIDZero is when any spans in a trace have TraceId=0 TraceIDZero int64 // SpanIDZero is when any span has SpanId=0 SpanIDZero int64 // ForeignSpan is when a span in a trace has a TraceId that is different than the first span in the trace ForeignSpan int64 }
TracesDropped contains counts for reasons traces have been dropped
func (*TracesDropped) String ¶
func (s *TracesDropped) String() string