ssf

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2017 License: MIT Imports: 3 Imported by: 0

README

Simple Sensor format

The Simple Sensor Format — or SSF for short — is a language agnostic format for transmitting observability data such as trace spans, metrics, events and more.

Why?

SSF is based on prior art of metrics formats and protocols mentioned in the inspiration section. Unlike each of these wonderful formats, which we have used for years and benefited greatly from, SSF is a binary format utilizing Protocol Buffers. It is emission, collection and storage agnostic. It is merely a protocol for transmitting information. It is developed as part of a suite of technologies around Veneur.

Why A New Format?

Because we want to:

  • leverage protobuf so we no longer have to write buggy, string-based marshaling and unmarshaling code in clients libraries and server imeplementations
  • benefit from the efficiency of protobuf
  • collect and combine the great ideas from our inspiration.
  • add some of our own ideas

Philosophy

We've got some novel ideas that we've put in to SSF. It might help to be familiar with the concepts in our inspiration Here they are:

  • a timer is a span
  • a log line is a span, especially if it's structured
  • events are also spans
  • therefore, the core unit of all observability data is a span, or a unit of a trace.
    • spans might be single units, or units of a larger whole
  • other point metrics (e.g. counters and gauges) can be constituents of a span
    • it's more valuable to know the depth of a queue in the context of a span than alone
    • improve the context of counters and gauges, as they are part of a span
  • provide a format containing the superset of many backend's features

Inspiration

We build on the shoulders of giants, and are proud to have used and been inspired by these marvelous tools:

Documentation

Overview

Package ssf is a generated protocol buffer package.

It is generated from these files:

ssf/sample.proto

It has these top-level messages:

SSFSample
SSFSpan

Index

Constants

This section is empty.

Variables

View Source
var SSFSample_Metric_name = map[int32]string{
	0: "COUNTER",
	1: "GAUGE",
	2: "HISTOGRAM",
	3: "SET",
	4: "STATUS",
}
View Source
var SSFSample_Metric_value = map[string]int32{
	"COUNTER":   0,
	"GAUGE":     1,
	"HISTOGRAM": 2,
	"SET":       3,
	"STATUS":    4,
}
View Source
var SSFSample_Status_name = map[int32]string{
	0: "OK",
	1: "WARNING",
	2: "CRITICAL",
	3: "UNKNOWN",
}
View Source
var SSFSample_Status_value = map[string]int32{
	"OK":       0,
	"WARNING":  1,
	"CRITICAL": 2,
	"UNKNOWN":  3,
}

Functions

This section is empty.

Types

type SSFSample

type SSFSample struct {
	// The underlying type of the metric
	Metric SSFSample_Metric `protobuf:"varint,1,opt,name=metric,enum=ssf.SSFSample_Metric" json:"metric,omitempty"`
	// no spaces, but . is allowed
	// e.g.: veneur.bar.baz
	Name       string            `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	Value      float32           `protobuf:"fixed32,3,opt,name=value" json:"value,omitempty"`
	Timestamp  int64             `protobuf:"varint,4,opt,name=timestamp" json:"timestamp,omitempty"`
	Message    string            `protobuf:"bytes,5,opt,name=message" json:"message,omitempty"`
	Status     SSFSample_Status  `protobuf:"varint,6,opt,name=status,enum=ssf.SSFSample_Status" json:"status,omitempty"`
	SampleRate float32           `protobuf:"fixed32,7,opt,name=sample_rate,json=sampleRate" json:"sample_rate,omitempty"`
	Tags       map[string]string `` /* 128-byte string literal not displayed */
	Unit       string            `protobuf:"bytes,9,opt,name=unit" json:"unit,omitempty"`
}

func (*SSFSample) Descriptor

func (*SSFSample) Descriptor() ([]byte, []int)

func (*SSFSample) GetMessage

func (m *SSFSample) GetMessage() string

func (*SSFSample) GetMetric

func (m *SSFSample) GetMetric() SSFSample_Metric

func (*SSFSample) GetName

func (m *SSFSample) GetName() string

func (*SSFSample) GetSampleRate

func (m *SSFSample) GetSampleRate() float32

func (*SSFSample) GetStatus

func (m *SSFSample) GetStatus() SSFSample_Status

func (*SSFSample) GetTags

func (m *SSFSample) GetTags() map[string]string

func (*SSFSample) GetTimestamp

func (m *SSFSample) GetTimestamp() int64

func (*SSFSample) GetUnit

func (m *SSFSample) GetUnit() string

func (*SSFSample) GetValue added in v1.5.0

func (m *SSFSample) GetValue() float32

func (*SSFSample) ProtoMessage

func (*SSFSample) ProtoMessage()

func (*SSFSample) Reset

func (m *SSFSample) Reset()

func (*SSFSample) String

func (m *SSFSample) String() string

type SSFSample_Metric

type SSFSample_Metric int32
const (
	SSFSample_COUNTER   SSFSample_Metric = 0
	SSFSample_GAUGE     SSFSample_Metric = 1
	SSFSample_HISTOGRAM SSFSample_Metric = 2
	SSFSample_SET       SSFSample_Metric = 3
	SSFSample_STATUS    SSFSample_Metric = 4
)

func (SSFSample_Metric) EnumDescriptor

func (SSFSample_Metric) EnumDescriptor() ([]byte, []int)

func (SSFSample_Metric) String

func (x SSFSample_Metric) String() string

type SSFSample_Status

type SSFSample_Status int32
const (
	SSFSample_OK       SSFSample_Status = 0
	SSFSample_WARNING  SSFSample_Status = 1
	SSFSample_CRITICAL SSFSample_Status = 2
	SSFSample_UNKNOWN  SSFSample_Status = 3
)

func (SSFSample_Status) EnumDescriptor

func (SSFSample_Status) EnumDescriptor() ([]byte, []int)

func (SSFSample_Status) String

func (x SSFSample_Status) String() string

type SSFSpan added in v1.5.0

type SSFSpan struct {
	Version int32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"`
	// the trace_id is the (span) id of the root span
	TraceId int64 `protobuf:"varint,2,opt,name=trace_id,json=traceId" json:"trace_id,omitempty"`
	// the id for this span
	Id int64 `protobuf:"varint,3,opt,name=id" json:"id,omitempty"`
	// the (span) id of the direct parent,
	// if this span is not a root span
	ParentId       int64 `protobuf:"varint,4,opt,name=parent_id,json=parentId" json:"parent_id,omitempty"`
	StartTimestamp int64 `protobuf:"varint,5,opt,name=start_timestamp,json=startTimestamp" json:"start_timestamp,omitempty"`
	EndTimestamp   int64 `protobuf:"varint,6,opt,name=end_timestamp,json=endTimestamp" json:"end_timestamp,omitempty"`
	Error          bool  `protobuf:"varint,7,opt,name=error" json:"error,omitempty"`
	// The name of the service
	// e.g. "veneur"
	Service string `protobuf:"bytes,8,opt,name=service" json:"service,omitempty"`
	// The thing we're doing, handing a request, writing a value, etc
	Operation string            `protobuf:"bytes,9,opt,name=operation" json:"operation,omitempty"`
	Metrics   []*SSFSample      `protobuf:"bytes,10,rep,name=metrics" json:"metrics,omitempty"`
	Tags      map[string]string `` /* 129-byte string literal not displayed */
}

func (*SSFSpan) Descriptor added in v1.5.0

func (*SSFSpan) Descriptor() ([]byte, []int)

func (*SSFSpan) GetEndTimestamp added in v1.5.0

func (m *SSFSpan) GetEndTimestamp() int64

func (*SSFSpan) GetError added in v1.5.0

func (m *SSFSpan) GetError() bool

func (*SSFSpan) GetId added in v1.5.0

func (m *SSFSpan) GetId() int64

func (*SSFSpan) GetMetrics added in v1.5.0

func (m *SSFSpan) GetMetrics() []*SSFSample

func (*SSFSpan) GetOperation added in v1.5.0

func (m *SSFSpan) GetOperation() string

func (*SSFSpan) GetParentId added in v1.5.0

func (m *SSFSpan) GetParentId() int64

func (*SSFSpan) GetService added in v1.5.0

func (m *SSFSpan) GetService() string

func (*SSFSpan) GetStartTimestamp added in v1.5.0

func (m *SSFSpan) GetStartTimestamp() int64

func (*SSFSpan) GetTags added in v1.5.0

func (m *SSFSpan) GetTags() map[string]string

func (*SSFSpan) GetTraceId added in v1.5.0

func (m *SSFSpan) GetTraceId() int64

func (*SSFSpan) GetVersion added in v1.5.0

func (m *SSFSpan) GetVersion() int32

func (*SSFSpan) ProtoMessage added in v1.5.0

func (*SSFSpan) ProtoMessage()

func (*SSFSpan) Reset added in v1.5.0

func (m *SSFSpan) Reset()

func (*SSFSpan) String added in v1.5.0

func (m *SSFSpan) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL