config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package config is a generated protocol buffer package.

The `signalfx` adapter collects Istio metrics and trace spans and sends them to [SignalFx](https://signalfx.com).

This adapter supports the [metric template](https://istio.io/docs/reference/config/policy-and-telemetry/templates/metric/) and the [tracespan template](https://istio.io/docs/reference/config/policy-and-telemetry/templates/tracespan/).

If sending trace spans, this adapter can make use of certain conventions in the tracespan format that is configured to send to this adapter. Here is an example tracespan spec that will work well:

```yaml apiVersion: config.istio.io/v1alpha2 kind: tracespan metadata:

name: signalfx

spec:

 traceId: request.headers["x-b3-traceid"] | ""
 spanId: request.headers["x-b3-spanid"] | ""
 parentSpanId: request.headers["x-b3-parentspanid"] | ""
 # If the path contains query parameters, they will be split off and put into
 # tags such that the span name sent to SignalFx will consist only of the path
 # itself.
 spanName: request.path | "/"
 startTime: request.time
 endTime: response.time
 # If this is >=500, the span will get an 'error' tag
 httpStatusCode: response.code | 0
 clientSpan: context.reporter.kind == "outbound"
 # Span tags below that do not have comments are useful but optional and will
 # be passed to SignalFx unmodified. The tags that have comments are interpreted
 # in a special manner, but are still optional.
 spanTags:
   # This gets put into the remoteEndpoint.ipv4 field
   destination.ip: destination.ip | ip("0.0.0.0")
   # This gets put into the remoteEndpoint.name field
   destination.name: destination.name | "unknown"
   destination.namespace: destination.namespace | "unknown"
   request.host: request.host | ""
   request.method: request.method | ""
   request.path: request.path | ""
   request.size: request.size | 0
   request.useragent: request.useragent | ""
   response.size: response.size | 0
   # This gets put into the localEndpoint.name field
   source.name: source.name | "unknown"
   # This gets put into the localEndpoint.ipv4 field
   source.ip: source.ip | ip("0.0.0.0")
   source.namespace: source.namespace | "unknown"
   source.version: source.labels["version"] | "unknown"
```

It is generated from these files:

mixer/adapter/signalfx/config/config.proto

It has these top-level messages:

Params

Index

Constants

View Source
const AccessTokenEnvvar = "SIGNALFX_ACCESS_TOKEN"

AccessTokenEnvvar is the name of the envvar that specifies the SignalFx access token

Variables

View Source
var (
	ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowConfig   = fmt.Errorf("proto: integer overflow")
)
View Source
var Params_MetricConfig_Type_name = map[int32]string{
	0: "NONE",
	1: "COUNTER",
	2: "HISTOGRAM",
}
View Source
var Params_MetricConfig_Type_value = map[string]int32{
	"NONE":      0,
	"COUNTER":   1,
	"HISTOGRAM": 2,
}

Functions

func Validate

func Validate(conf *Params) error

Validate the parsed config

Types

type Params

type Params struct {
	// Required. The set of metrics to send to SignalFx. If an Istio metric is
	// configured to be sent to this adapter, it must have a corresponding
	// description here.
	Metrics []*Params_MetricConfig `protobuf:"bytes,1,rep,name=metrics" json:"metrics,omitempty"`
	// Optional. The URL of the SignalFx ingest server to use.  Will default to
	// the global ingest server if not specified.
	IngestUrl string `protobuf:"bytes,2,opt,name=ingest_url,json=ingestUrl,proto3" json:"ingest_url,omitempty"`
	// Required. The access token for the SignalFx organization that should
	// receive the metrics.  This can also be configured via an environment
	// variable `SIGNALFX_ACCESS_TOKEN` set on the adapter process which makes
	// it possible to use Kubernetes secrets to provide the token.  This field,
	// if specified, will take priority over the environment variable.
	AccessToken string `protobuf:"bytes,3,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	// Optional. Specifies how frequently to send metrics to SignalFx.  Metrics
	// reported to this adapter are collected and reported as a timeseries.
	// This will be rounded to the nearest second and rounded values less than
	// one second are not valid. Defaults to 10 seconds if not specified.
	DatapointInterval time.Duration `protobuf:"bytes,4,opt,name=datapoint_interval,json=datapointInterval,stdduration" json:"datapoint_interval"`
	// Optional.  If set to false, metrics won't be sent (but trace spans will
	// be sent, unless otherwise disabled).
	EnableMetrics bool `protobuf:"varint,5,opt,name=enable_metrics,json=enableMetrics,proto3" json:"enable_metrics,omitempty"`
	// Optional.  If set to false, trace spans won't be sent (but metrics will
	// be sent, unless otherwise disabled).
	EnableTracing bool `protobuf:"varint,6,opt,name=enable_tracing,json=enableTracing,proto3" json:"enable_tracing,omitempty"`
	// Configuration for the Trace Span handler
	Tracing *Params_TracingConfig `protobuf:"bytes,7,opt,name=tracing" json:"tracing,omitempty"`
	// Optional. The full URL (including path) to the trace ingest server.
	// If this is not set, all trace spans will be sent to the same place
	// as ingestUrl above.
	TraceEndpointUrl string `protobuf:"bytes,8,opt,name=trace_endpoint_url,json=traceEndpointUrl,proto3" json:"trace_endpoint_url,omitempty"`
}

Configuration format for the `signalfx` adapter.

func (*Params) Descriptor

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

func (*Params) Marshal

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

func (m *Params) Size() (n int)

func (*Params) String

func (this *Params) String() string

func (*Params) Unmarshal

func (m *Params) Unmarshal(dAtA []byte) error

type Params_MetricConfig

type Params_MetricConfig struct {
	// Required.  The name of the metric as it is sent to the adapter.  In
	// Kubernetes this is of the form "<name>.metric.<namespace>" where
	// "<name>" is the name field of the metric resource, and "<namespace>"
	// is the namespace of the metric resource.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The metric type of the metric
	Type Params_MetricConfig_Type `protobuf:"varint,4,opt,name=type,proto3,enum=signalfx.config.Params_MetricConfig_Type" json:"type,omitempty"`
}

Describes what metrics should be sent to SignalFx and in what form.

func (*Params_MetricConfig) Descriptor

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

func (*Params_MetricConfig) Marshal

func (m *Params_MetricConfig) Marshal() (dAtA []byte, err error)

func (*Params_MetricConfig) MarshalTo

func (m *Params_MetricConfig) MarshalTo(dAtA []byte) (int, error)

func (*Params_MetricConfig) ProtoMessage

func (*Params_MetricConfig) ProtoMessage()

func (*Params_MetricConfig) Reset

func (m *Params_MetricConfig) Reset()

func (*Params_MetricConfig) Size

func (m *Params_MetricConfig) Size() (n int)

func (*Params_MetricConfig) String

func (this *Params_MetricConfig) String() string

func (*Params_MetricConfig) Unmarshal

func (m *Params_MetricConfig) Unmarshal(dAtA []byte) error

type Params_MetricConfig_Type

type Params_MetricConfig_Type int32

Describes what kind of metric this is.

const (
	// None is the default and is invalid
	NONE Params_MetricConfig_Type = 0
	// Values with the same set of dimensions will be added together
	// as a continuously incrementing value.
	COUNTER Params_MetricConfig_Type = 1
	// A histogram distribution.  This will result in several metrics
	// emitted for each unique set of dimensions.
	HISTOGRAM Params_MetricConfig_Type = 2
)

func (Params_MetricConfig_Type) EnumDescriptor

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

func (Params_MetricConfig_Type) String

func (x Params_MetricConfig_Type) String() string

type Params_TracingConfig

type Params_TracingConfig struct {
	// Optional.  The number of trace spans that the adapter will buffer before
	// dropping them.  This defaults to 1000 spans but can be configured higher
	// if needed.  An error message will be logged if spans are dropped.
	BufferSize uint32 `protobuf:"varint,1,opt,name=buffer_size,json=bufferSize,proto3" json:"buffer_size,omitempty"`
	// The span tag that is used as the value of the localEndpoint.serviceName
	// field of the span sent to SignalFx
	LocalEndpointNameTagKey string `` /* 136-byte string literal not displayed */
	// The span tag that is used as the value of the localEndpoint.ipv4
	// field of the span sent to SignalFx
	LocalEndpointIpTagKey string `` /* 130-byte string literal not displayed */
	// The span tag that is used as the value of the remoteEndpoint.serviceName
	// field of the span sent to SignalFx
	RemoteEndpointNameTagKey string `` /* 139-byte string literal not displayed */
	// The span tag that is used as the value of the remoteEndpoint.ipv4
	// field of the span sent to SignalFx
	RemoteEndpointIpTagKey string `` /* 133-byte string literal not displayed */
	// If true, the local and remote endpoints will be swapped for
	// non-client spans.  This means that the above config options for
	// [local/remote]_endpoint_[name/ip]_tag_key with have a reversed
	// meaning for server spans.  The `clientSpan` field in the `tracespan`
	// instance that is used with this adapter determines what is a
	// "client" vs a "server" span.
	SwapLocalRemoteEndpoints bool `` /* 138-byte string literal not displayed */
}

Holds all of the tracing-specific configuration

func (*Params_TracingConfig) Descriptor

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

func (*Params_TracingConfig) Marshal

func (m *Params_TracingConfig) Marshal() (dAtA []byte, err error)

func (*Params_TracingConfig) MarshalTo

func (m *Params_TracingConfig) MarshalTo(dAtA []byte) (int, error)

func (*Params_TracingConfig) ProtoMessage

func (*Params_TracingConfig) ProtoMessage()

func (*Params_TracingConfig) Reset

func (m *Params_TracingConfig) Reset()

func (*Params_TracingConfig) Size

func (m *Params_TracingConfig) Size() (n int)

func (*Params_TracingConfig) String

func (this *Params_TracingConfig) String() string

func (*Params_TracingConfig) Unmarshal

func (m *Params_TracingConfig) Unmarshal(dAtA []byte) error

Jump to

Keyboard shortcuts

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