tally: github.com/uber-go/tally/m3 Index | Files | Directories

package m3

import "github.com/uber-go/tally/m3"

Index

Package Files

config.go reporter.go resource_pool.go sanitize.go

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(1440)
    // 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,
    }
)

type Configuration Uses

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"`
}

Configuration is a configuration for a M3 reporter.

func (Configuration) NewReporter Uses

func (c Configuration) NewReporter() (Reporter, error)

NewReporter creates a new M3 reporter from this configuration.

type Options Uses

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
}

Options is a set of options for the M3 reporter.

type Protocol Uses

type Protocol int

Protocol describes a M3 thrift transport protocol.

const (
    Compact Protocol = iota
    Binary
)

Compact and Binary represent the compact and binary thrift protocols respectively.

type Reporter Uses

type Reporter interface {
    tally.CachedStatsReporter
    io.Closer
}

Reporter is an M3 reporter.

func NewReporter Uses

func NewReporter(opts Options) (Reporter, error)

NewReporter creates a new M3 reporter.

Directories

PathSynopsis
customtransports
example
thrift
thriftudp

Package m3 imports 13 packages (graph) and is imported by 10 packages. Updated 2019-06-20. Refresh now. Tools for package owners.