package m3
import "github.com/uber-go/tally/m3"
Index ¶
Constants ¶
const ( // ServiceTag is the name of the M3 service tag. ServiceTag = "service" // EnvTag is the name of the M3 env tag. EnvTag = "env" // HostTag is the name of the M3 host tag. HostTag = "host" // DefaultMaxQueueSize is the default M3 reporter queue size. DefaultMaxQueueSize = 4096 // DefaultMaxPacketSize is the default M3 reporter max packet size. DefaultMaxPacketSize = int32(32768) // DefaultHistogramBucketIDName is the default histogram bucket ID tag name DefaultHistogramBucketIDName = "bucketid" // DefaultHistogramBucketName is the default histogram bucket name tag name DefaultHistogramBucketName = "bucket" // DefaultHistogramBucketTagPrecision is the default // precision to use when formatting the metric tag // with the histogram bucket bound values. DefaultHistogramBucketTagPrecision = uint(6) )
Variables ¶
var ( // DefaultSanitizerOpts are the options for the default M3 sanitizer. DefaultSanitizerOpts = tally.SanitizeOptions{ NameCharacters: tally.ValidCharacters{ Ranges: tally.AlphanumericRange, Characters: tally.UnderscoreDashDotCharacters, }, KeyCharacters: tally.ValidCharacters{ Ranges: tally.AlphanumericRange, Characters: tally.UnderscoreDashCharacters, }, ValueCharacters: tally.ValidCharacters{ Ranges: tally.AlphanumericRange, Characters: tally.UnderscoreDashDotCharacters, }, ReplacementCharacter: tally.DefaultReplacementCharacter, } )
Types ¶
type Configuration ¶
type Configuration struct { // HostPort is the host and port of the M3 server. HostPort string `yaml:"hostPort" validate:"nonzero"` // HostPorts are the host and port of the M3 server. HostPorts []string `yaml:"hostPorts"` // Service is the service tag to that this client emits. Service string `yaml:"service" validate:"nonzero"` // Env is the env tag to use that this client emits. Env string `yaml:"env" validate:"nonzero"` // CommonTags are tags that are common for all metrics this client emits. CommonTags map[string]string `yaml:"tags" ` // Queue is the maximum metric queue size of client. Queue int `yaml:"queue"` // PacketSize is the maximum packet size for a batch of metrics. PacketSize int32 `yaml:"packetSize"` // IncludeHost is whether or not to include host tag. IncludeHost bool `yaml:"includeHost"` // HistogramBucketTagPrecision is precision to use when formatting the metric tag // with the histogram bucket bound values. HistogramBucketTagPrecision uint `yaml:"histogramBucketTagPrecision"` // InternalTags are tags that should be added to all internal metrics // emitted by the reporter. InternalTags map[string]string `yaml:"internalTags"` }
Configuration is a configuration for a M3 reporter.
func (Configuration) NewReporter ¶
func (c Configuration) NewReporter() (Reporter, error)
NewReporter creates a new M3 reporter from this configuration.
type Options ¶
type Options struct { HostPorts []string Service string Env string CommonTags map[string]string IncludeHost bool Protocol Protocol MaxQueueSize int MaxPacketSizeBytes int32 HistogramBucketIDName string HistogramBucketName string HistogramBucketTagPrecision uint InternalTags map[string]string }
Options is a set of options for the M3 reporter.
type Protocol ¶
type Protocol int
Protocol describes a M3 thrift transport protocol.
Compact and Binary represent the compact and binary thrift protocols respectively.
type Reporter ¶
type Reporter interface { tally.CachedStatsReporter io.Closer }
Reporter is an M3 reporter.
func NewReporter ¶
NewReporter creates a new M3 reporter.
Source Files ¶
config.go reporter.go resource_pool.go sanitize.go
Directories ¶
Path | Synopsis |
---|---|
m3/customtransports | |
m3/example | |
m3/thrift | |
m3/thriftudp | |
m3/thrift/v1 | |
m3/thrift/v2 |
- Version
- v3.5.10+incompatible (latest)
- Published
- Mar 6, 2024
- Platform
- linux/amd64
- Imports
- 17 packages
- Last checked
- 2 months ago –
Tools for package owners.