Version: v3.0.0+incompatible Latest Latest

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

Go to latest
Published: Mar 14, 2017 License: MIT Imports: 13 Imported by: 0




View Source
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)


This section is empty.


This section is empty.


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

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

Options is a set of options for the M3 reporter.

type Protocol

type Protocol int

Protocol describes a M3 thrift transport protocol.

const (
	Compact Protocol = iota

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

type Reporter

type Reporter interface {

Reporter is an M3 reporter.

func NewReporter

func NewReporter(opts Options) (Reporter, error)

NewReporter creates a new M3 reporter.


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL