Documentation
¶
Index ¶
- func AddTags(tags []string, vals ...string) []string
- func AddTagsMap(tags []string, vals map[string]string) []string
- func New(v *validator.Validate, opts ...writerOption) (*writer, error)
- func NewTallyScope(mw Writer) (tally.Scope, io.Closer)
- func SplitTag(tag string) (string, string)
- func ToBoolTag(name string, val bool) string
- func ToStatusTag(status string) []string
- func ToStatusTypeTag(status, typ string) []string
- func ToTag(name, val string) string
- func ToTags(inputs map[string]string, addtlTags ...string) []string
- func WithAddress(addr string) writerOption
- func WithDisable(disable bool) writerOption
- func WithLogger(log *zap.Logger) writerOption
- func WithTagMap(tags map[string]string) writerOption
- func WithTags(tags ...string) writerOption
- type Decr
- type Event
- type Gauge
- type Incr
- type TallyReporter
- func (w *TallyReporter) Capabilities() tally.Capabilities
- func (w *TallyReporter) Flush()
- func (w *TallyReporter) ReportCounter(name string, tags map[string]string, value int64)
- func (w *TallyReporter) ReportGauge(name string, tags map[string]string, value float64)
- func (w *TallyReporter) ReportHistogramDurationSamples(name string, tags map[string]string, buckets tally.Buckets, ...)
- func (w *TallyReporter) ReportHistogramValueSamples(name string, tags map[string]string, buckets tally.Buckets, ...)
- func (w *TallyReporter) ReportTimer(name string, tags map[string]string, interval time.Duration)
- type Timing
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTallyScope ¶
NewTallyScope creates a new tally scope with the given metrics.Writer as the backend, by way of the TallyReporter wrapper.
Tags to be persisted on all metrics emitted via the returned tally.Scope should be attached to the provided Writer.
The returned io.Closer should be closed when no more telemetry is to be written to the scope.
func ToStatusTag ¶
func ToStatusTypeTag ¶
func ToTags ¶
ToTags is a flexible tag creator, which can accept a map (for default tags), and either partial tags or full tags.
For instance, both the following string parameter sets are equivalent: ToTags(defaultTags, "status", "ok", "step:step-2") ToTags(defaultTags, "status", "ok", "step", "step-2") ToTags(defaultTags, "status:ok", "step:step-2")
func WithAddress ¶
func WithAddress(addr string) writerOption
func WithDisable ¶
func WithDisable(disable bool) writerOption
func WithLogger ¶
func WithTagMap ¶
Types ¶
type Gauge ¶
type TallyReporter ¶
type TallyReporter struct {
// contains filtered or unexported fields
}
TallyReporter is a wrapper around the metrics.Writer interface that conforms to tally.StatsReporter, allowing us to use the same metrics.Writer implementation for temporal's client, which expects a tally.Scope type TallyReporter metrics.Writer
func (*TallyReporter) Capabilities ¶
func (w *TallyReporter) Capabilities() tally.Capabilities
Capabilities implements tally.StatsReporter.
func (*TallyReporter) ReportCounter ¶
func (w *TallyReporter) ReportCounter(name string, tags map[string]string, value int64)
func (*TallyReporter) ReportGauge ¶
func (w *TallyReporter) ReportGauge(name string, tags map[string]string, value float64)
ReportGauge implements tally.StatsReporter.
func (*TallyReporter) ReportHistogramDurationSamples ¶
func (w *TallyReporter) ReportHistogramDurationSamples(name string, tags map[string]string, buckets tally.Buckets, bucketLowerBound time.Duration, bucketUpperBound time.Duration, samples int64)
ReportHistogramDurationSamples implements tally.StatsReporter as a no-op.
Tally's interface assumes histograms that are calculated/aggregated client-side. Datadog wants to aggregate histograms in their agent. We could sorta-approximate this by breaking down the input histogram as a series of gauges, but the agent would then smash the data points in the time range together, significantly undermining the fidelity of histogram data.
So, rather than produce potentially bad data that increases noise in our obs platform, we err on the side of just dropping this data. We can always revisit if there's a compelling need for some metrics expressed as histograms that outweights the risk of noise.
func (*TallyReporter) ReportHistogramValueSamples ¶
func (w *TallyReporter) ReportHistogramValueSamples(name string, tags map[string]string, buckets tally.Buckets, bucketLowerBound float64, bucketUpperBound float64, samples int64)
ReportHistogramValueSamples implements tally.StatsReporter as a no-op.
See ReportHistogramDurationSamples for no-op rationale.
func (*TallyReporter) ReportTimer ¶
ReportTimer implements tally.StatsReporter.
type Timing ¶
type Writer ¶
type Writer interface {
// dogstatsd metrics
Incr(name string, tags []string)
Decr(name string, tags []string)
Timing(name string, value time.Duration, tags []string)
Gauge(name string, value float64, tags []string)
Count(name string, value int64, tags []string)
// datadog specific
Event(e *statsd.Event)
Flush()
}