v1

package
v0.0.0-...-524036e Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PropagationFormat_name = map[int32]string{
		0: "B3",
		1: "TRACECONTEXT",
	}
	PropagationFormat_value = map[string]int32{
		"B3":           0,
		"TRACECONTEXT": 1,
	}
)

Enum value maps for PropagationFormat.

View Source
var (
	TraceReporterType_name = map[int32]string{
		0: "UNSPECIFIED",
		1: "ZIPKIN",
		2: "OTLP",
		3: "LOGGING",
		4: "NONE",
		5: "OTLP_HTTP",
	}
	TraceReporterType_value = map[string]int32{
		"UNSPECIFIED": 0,
		"ZIPKIN":      1,
		"OTLP":        2,
		"LOGGING":     3,
		"NONE":        4,
		"OTLP_HTTP":   5,
	}
)

Enum value maps for TraceReporterType.

View Source
var (
	MetricReporterType_name = map[int32]string{
		0: "METRIC_REPORTER_TYPE_UNSPECIFIED",
		1: "METRIC_REPORTER_TYPE_OTLP",
		2: "METRIC_REPORTER_TYPE_PROMETHEUS",
		3: "METRIC_REPORTER_TYPE_LOGGING",
		4: "METRIC_REPORTER_TYPE_NONE",
	}
	MetricReporterType_value = map[string]int32{
		"METRIC_REPORTER_TYPE_UNSPECIFIED": 0,
		"METRIC_REPORTER_TYPE_OTLP":        1,
		"METRIC_REPORTER_TYPE_PROMETHEUS":  2,
		"METRIC_REPORTER_TYPE_LOGGING":     3,
		"METRIC_REPORTER_TYPE_NONE":        4,
	}
)

Enum value maps for MetricReporterType.

View Source
var File_hypertrace_agent_config_v1_config_proto protoreflect.FileDescriptor

Functions

func Bool

func Bool(val bool) *wrapperspb.BoolValue

Bool wraps the scalar value to be used in the AgentConfig object

func Int32

func Int32(val int32) *wrapperspb.Int32Value

String wraps the scalar value to be used in the AgentConfig object

func String

func String(val string) *wrapperspb.StringValue

String wraps the scalar value to be used in the AgentConfig object

Types

type AgentConfig

type AgentConfig struct {

	// service_name identifies the service/process running e.g. "my service"
	ServiceName *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	// reporting holds the reporting settings for the agent
	Reporting *Reporting `protobuf:"bytes,2,opt,name=reporting,proto3" json:"reporting,omitempty"`
	// data_capture describes the data being captured by instrumentation
	DataCapture *DataCapture `protobuf:"bytes,3,opt,name=data_capture,json=dataCapture,proto3" json:"data_capture,omitempty"`
	// propagation_formats list the supported propagation formats
	PropagationFormats []PropagationFormat `` /* 173-byte string literal not displayed */
	// when `false`, disables the agent
	Enabled *wrapperspb.BoolValue `protobuf:"bytes,5,opt,name=enabled,proto3" json:"enabled,omitempty"`
	// javaagent has the configs specific to javaagent
	Javaagent *JavaAgent `protobuf:"bytes,6,opt,name=javaagent,proto3" json:"javaagent,omitempty"`
	// resource_attributes map define the static list of resources which is configured on the tracer
	ResourceAttributes map[string]string `` /* 203-byte string literal not displayed */
	// telemetry
	Telemetry *Telemetry `protobuf:"bytes,8,opt,name=telemetry,proto3" json:"telemetry,omitempty"`
	// Goagent specific config
	Goagent *GoAgent `protobuf:"bytes,9,opt,name=goagent,proto3" json:"goagent,omitempty"`
	// contains filtered or unexported fields
}

AgentConfig covers the config for agents. The config uses wrappers for primitive types to allow nullable values. The nullable values are used for instance to explicitly disable data capture or secure connection. Since the wrappers change structure of the objects the marshalling and unmarshalling have to be done via protobuf marshallers.

func Load

func Load(opts ...LoadOption) *AgentConfig

Load loads the configuration from the default values, config file and env vars with a given prefix.

func LoadFromFile

func LoadFromFile(configFile string, opts ...LoadOption) *AgentConfig

LoadFromFile loads the configuration from the default values, config file and env vars.

func (*AgentConfig) Descriptor deprecated

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

Deprecated: Use AgentConfig.ProtoReflect.Descriptor instead.

func (*AgentConfig) GetDataCapture

func (x *AgentConfig) GetDataCapture() *DataCapture

func (*AgentConfig) GetEnabled

func (x *AgentConfig) GetEnabled() *wrapperspb.BoolValue

func (*AgentConfig) GetGoagent

func (x *AgentConfig) GetGoagent() *GoAgent

func (*AgentConfig) GetJavaagent

func (x *AgentConfig) GetJavaagent() *JavaAgent

func (*AgentConfig) GetPropagationFormats

func (x *AgentConfig) GetPropagationFormats() []PropagationFormat

func (*AgentConfig) GetReporting

func (x *AgentConfig) GetReporting() *Reporting

func (*AgentConfig) GetResourceAttributes

func (x *AgentConfig) GetResourceAttributes() map[string]string

func (*AgentConfig) GetServiceName

func (x *AgentConfig) GetServiceName() *wrapperspb.StringValue

func (*AgentConfig) GetTelemetry

func (x *AgentConfig) GetTelemetry() *Telemetry

func (*AgentConfig) LoadFromEnv

func (x *AgentConfig) LoadFromEnv(opts ...LoadOption)

LoadFromEnv loads env and default values on existing AgentConfig instance where defaults only overrides empty values while env vars can override all of them.

func (*AgentConfig) ProtoMessage

func (*AgentConfig) ProtoMessage()

func (*AgentConfig) ProtoReflect

func (x *AgentConfig) ProtoReflect() protoreflect.Message

func (*AgentConfig) PutResourceAttributes

func (x *AgentConfig) PutResourceAttributes(m map[string]string)

PutResourceAttributes sets values in the ResourceAttributes map.

func (*AgentConfig) Reset

func (x *AgentConfig) Reset()

func (*AgentConfig) String

func (x *AgentConfig) String() string

type DataCapture

type DataCapture struct {

	// http_headers enables/disables the capture of the request/response headers in HTTP
	HttpHeaders *Message `protobuf:"bytes,1,opt,name=http_headers,json=httpHeaders,proto3" json:"http_headers,omitempty"`
	// http_body enables/disables the capture of the request/response body in HTTP
	HttpBody *Message `protobuf:"bytes,2,opt,name=http_body,json=httpBody,proto3" json:"http_body,omitempty"`
	// rpc_metadata enables/disables the capture of the request/response metadata in RPC
	RpcMetadata *Message `protobuf:"bytes,3,opt,name=rpc_metadata,json=rpcMetadata,proto3" json:"rpc_metadata,omitempty"`
	// rpc_body enables/disables the capture of the request/response body in RPC
	RpcBody *Message `protobuf:"bytes,4,opt,name=rpc_body,json=rpcBody,proto3" json:"rpc_body,omitempty"`
	// body_max_size_bytes is the maximum size of captured body in bytes.
	// Default should be 131_072 (128 KiB).
	BodyMaxSizeBytes *wrapperspb.Int32Value `protobuf:"bytes,5,opt,name=body_max_size_bytes,json=bodyMaxSizeBytes,proto3" json:"body_max_size_bytes,omitempty"`
	// body_max_processing_size_bytes is maximum size of body being processed by filters in bytes.
	// Default should be 1_048_576 (1MB).
	//
	// For uncompressed bodies we capture all bytes up to `body_max_processing_size_bytes`
	// in memory and pass that through the filter.
	// For compressed and GRPC bodies, if the size of the body is larger than this, we ignore
	// it entirely, otherwise we decompress/decode the body and then pass it to the filter.
	BodyMaxProcessingSizeBytes *wrapperspb.Int32Value `` /* 145-byte string literal not displayed */
	// Array of allowed content type substrings to record
	// default should be json, x-www-form-urlencoded
	// ex: ["json"] will record any request bodies that have a content-type header that includes "json"
	AllowedContentTypes []*wrapperspb.StringValue `protobuf:"bytes,10,rep,name=allowed_content_types,json=allowedContentTypes,proto3" json:"allowed_content_types,omitempty"`
	// contains filtered or unexported fields
}

DataCapture describes the elements to be captured by the agent instrumentation

func (*DataCapture) Descriptor deprecated

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

Deprecated: Use DataCapture.ProtoReflect.Descriptor instead.

func (*DataCapture) GetAllowedContentTypes

func (x *DataCapture) GetAllowedContentTypes() []*wrapperspb.StringValue

func (*DataCapture) GetBodyMaxProcessingSizeBytes

func (x *DataCapture) GetBodyMaxProcessingSizeBytes() *wrapperspb.Int32Value

func (*DataCapture) GetBodyMaxSizeBytes

func (x *DataCapture) GetBodyMaxSizeBytes() *wrapperspb.Int32Value

func (*DataCapture) GetHttpBody

func (x *DataCapture) GetHttpBody() *Message

func (*DataCapture) GetHttpHeaders

func (x *DataCapture) GetHttpHeaders() *Message

func (*DataCapture) GetRpcBody

func (x *DataCapture) GetRpcBody() *Message

func (*DataCapture) GetRpcMetadata

func (x *DataCapture) GetRpcMetadata() *Message

func (*DataCapture) ProtoMessage

func (*DataCapture) ProtoMessage()

func (*DataCapture) ProtoReflect

func (x *DataCapture) ProtoReflect() protoreflect.Message

func (*DataCapture) Reset

func (x *DataCapture) Reset()

func (*DataCapture) String

func (x *DataCapture) String() string

type GoAgent

type GoAgent struct {

	// use the custom batch_span_processor adapted from the one in opentelemetry go
	// and supports some additional metrics
	UseCustomBsp *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=use_custom_bsp,json=useCustomBsp,proto3" json:"use_custom_bsp,omitempty"`
	// contains filtered or unexported fields
}

GoAgent has the configs specific to goagent

func (*GoAgent) Descriptor deprecated

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

Deprecated: Use GoAgent.ProtoReflect.Descriptor instead.

func (*GoAgent) GetUseCustomBsp

func (x *GoAgent) GetUseCustomBsp() *wrapperspb.BoolValue

func (*GoAgent) ProtoMessage

func (*GoAgent) ProtoMessage()

func (*GoAgent) ProtoReflect

func (x *GoAgent) ProtoReflect() protoreflect.Message

func (*GoAgent) Reset

func (x *GoAgent) Reset()

func (*GoAgent) String

func (x *GoAgent) String() string

type JavaAgent

type JavaAgent struct {

	// filter_jar_paths is the list of path to filter jars, separated by `,`
	FilterJarPaths []*wrapperspb.StringValue `protobuf:"bytes,1,rep,name=filter_jar_paths,json=filterJarPaths,proto3" json:"filter_jar_paths,omitempty"`
	// contains filtered or unexported fields
}

JavaAgent has the configs specific to javaagent

func (*JavaAgent) Descriptor deprecated

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

Deprecated: Use JavaAgent.ProtoReflect.Descriptor instead.

func (*JavaAgent) GetFilterJarPaths

func (x *JavaAgent) GetFilterJarPaths() []*wrapperspb.StringValue

func (*JavaAgent) ProtoMessage

func (*JavaAgent) ProtoMessage()

func (*JavaAgent) ProtoReflect

func (x *JavaAgent) ProtoReflect() protoreflect.Message

func (*JavaAgent) Reset

func (x *JavaAgent) Reset()

func (*JavaAgent) String

func (x *JavaAgent) String() string

type LoadOption

type LoadOption func(o *opts)

func WithDefaults

func WithDefaults(defaults *AgentConfig) LoadOption

func WithEnvPrefix

func WithEnvPrefix(prefix string) LoadOption

type Message

type Message struct {

	// when `false` it disables the capture for the request in a client/request operation
	Request *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
	// when `false` it disables the capture for the response in a client/request operation
	Response *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
	// contains filtered or unexported fields
}

Message describes what message should be considered for certain DataCapture option

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetRequest

func (x *Message) GetRequest() *wrapperspb.BoolValue

func (*Message) GetResponse

func (x *Message) GetResponse() *wrapperspb.BoolValue

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

func (x *Message) ProtoReflect() protoreflect.Message

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type MetricReporterType

type MetricReporterType int32

MetricReporterType represents the reporting format for metric data.

const (
	// Default to none. Agent will use it's default reporting type
	MetricReporterType_METRIC_REPORTER_TYPE_UNSPECIFIED MetricReporterType = 0
	// OpenTelemetry protobuf reporting format.
	// see https://github.com/open-telemetry/opentelemetry-proto
	MetricReporterType_METRIC_REPORTER_TYPE_OTLP MetricReporterType = 1
	// Prometheus exposition format.
	// see https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md
	MetricReporterType_METRIC_REPORTER_TYPE_PROMETHEUS MetricReporterType = 2
	// Logging reporting format
	MetricReporterType_METRIC_REPORTER_TYPE_LOGGING MetricReporterType = 3
	// Disable metric reporting
	MetricReporterType_METRIC_REPORTER_TYPE_NONE MetricReporterType = 4
)

func (MetricReporterType) Descriptor

func (MetricReporterType) Enum

func (MetricReporterType) EnumDescriptor deprecated

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

Deprecated: Use MetricReporterType.Descriptor instead.

func (MetricReporterType) Number

func (MetricReporterType) String

func (x MetricReporterType) String() string

func (MetricReporterType) Type

type PropagationFormat

type PropagationFormat int32

PropagationFormat represents the propagation formats supported by agents

const (
	// B3 propagation format, agents should support both multi and single value formats
	// see https://github.com/openzipkin/b3-propagation
	PropagationFormat_B3 PropagationFormat = 0
	// W3C Propagation format
	// see https://www.w3.org/TR/trace-context/
	PropagationFormat_TRACECONTEXT PropagationFormat = 1
)

func (PropagationFormat) Descriptor

func (PropagationFormat) Enum

func (PropagationFormat) EnumDescriptor deprecated

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

Deprecated: Use PropagationFormat.Descriptor instead.

func (PropagationFormat) Number

func (PropagationFormat) String

func (x PropagationFormat) String() string

func (PropagationFormat) Type

type Reporting

type Reporting struct {

	// endpoint represents the endpoint for reporting the traces
	// For ZIPKIN reporter type use http://api.traceable.ai:9411/api/v2/spans
	// For OTLP reporter type use http://api.traceable.ai:4317
	Endpoint *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	// when `true`, connects to endpoints over TLS.
	Secure *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=secure,proto3" json:"secure,omitempty"`
	// user specific token to access Traceable API
	Token *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
	// reporter type for traces.
	TraceReporterType TraceReporterType `` /* 165-byte string literal not displayed */
	// Certificate file containing the CA to verify the server's certificate.
	// This is for private certificates.
	// If this is set then `secure` above should also be set to `true`.
	CertFile *wrapperspb.StringValue `protobuf:"bytes,6,opt,name=cert_file,json=certFile,proto3" json:"cert_file,omitempty"`
	// metric_endpoint represents the endpoint for reporting the metrics.
	// For OTLP metric reporter type use http://api.traceable.ai:4317
	MetricEndpoint *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=metric_endpoint,json=metricEndpoint,proto3" json:"metric_endpoint,omitempty"`
	// reporter type for metrics.
	MetricReporterType MetricReporterType `` /* 169-byte string literal not displayed */
	// When `true`, modifies grpc resolver to use dns instead of passthrough and configure round robin client side loadbalancing
	EnableGrpcLoadbalancing *wrapperspb.BoolValue `` /* 132-byte string literal not displayed */
	// contains filtered or unexported fields
}

Reporting covers the options related to the mechanics for sending data to the tracing server o collector.

func (*Reporting) Descriptor deprecated

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

Deprecated: Use Reporting.ProtoReflect.Descriptor instead.

func (*Reporting) GetCertFile

func (x *Reporting) GetCertFile() *wrapperspb.StringValue

func (*Reporting) GetEnableGrpcLoadbalancing

func (x *Reporting) GetEnableGrpcLoadbalancing() *wrapperspb.BoolValue

func (*Reporting) GetEndpoint

func (x *Reporting) GetEndpoint() *wrapperspb.StringValue

func (*Reporting) GetMetricEndpoint

func (x *Reporting) GetMetricEndpoint() *wrapperspb.StringValue

func (*Reporting) GetMetricReporterType

func (x *Reporting) GetMetricReporterType() MetricReporterType

func (*Reporting) GetSecure

func (x *Reporting) GetSecure() *wrapperspb.BoolValue

func (*Reporting) GetToken

func (x *Reporting) GetToken() *wrapperspb.StringValue

func (*Reporting) GetTraceReporterType

func (x *Reporting) GetTraceReporterType() TraceReporterType

func (*Reporting) ProtoMessage

func (*Reporting) ProtoMessage()

func (*Reporting) ProtoReflect

func (x *Reporting) ProtoReflect() protoreflect.Message

func (*Reporting) Reset

func (x *Reporting) Reset()

func (*Reporting) String

func (x *Reporting) String() string

type Telemetry

type Telemetry struct {

	// when `true`, an internal span is created and exported when the agent is initialized and started.
	// It's useful to denote when the application the agent is in started.
	StartupSpanEnabled *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=startup_span_enabled,json=startupSpanEnabled,proto3" json:"startup_span_enabled,omitempty"`
	// Whether to capture metrics or not. The metrics will be otel go metrics.
	// See https://github.com/open-telemetry/opentelemetry-go/tree/main/metric
	MetricsEnabled *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=metrics_enabled,json=metricsEnabled,proto3" json:"metrics_enabled,omitempty"`
	// contains filtered or unexported fields
}

Telemetry has config for agent telemetry: traces and metrics on agent's performance and events.

func (*Telemetry) Descriptor deprecated

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

Deprecated: Use Telemetry.ProtoReflect.Descriptor instead.

func (*Telemetry) GetMetricsEnabled

func (x *Telemetry) GetMetricsEnabled() *wrapperspb.BoolValue

func (*Telemetry) GetStartupSpanEnabled

func (x *Telemetry) GetStartupSpanEnabled() *wrapperspb.BoolValue

func (*Telemetry) ProtoMessage

func (*Telemetry) ProtoMessage()

func (*Telemetry) ProtoReflect

func (x *Telemetry) ProtoReflect() protoreflect.Message

func (*Telemetry) Reset

func (x *Telemetry) Reset()

func (*Telemetry) String

func (x *Telemetry) String() string

type TraceReporterType

type TraceReporterType int32

TraceReporterType represents the reporting format for trace data.

const (
	// Default to none. Agent will use it's default reporting type
	TraceReporterType_UNSPECIFIED TraceReporterType = 0
	// Zipkin protobuf reporting format.
	// see https://github.com/openzipkin/zipkin-api
	TraceReporterType_ZIPKIN TraceReporterType = 1
	// OpenTelemetry protobuf reporting format.
	// see https://github.com/open-telemetry/opentelemetry-proto
	TraceReporterType_OTLP TraceReporterType = 2
	// Logging reporting format
	TraceReporterType_LOGGING TraceReporterType = 3
	// Disable trace reporting
	TraceReporterType_NONE TraceReporterType = 4
	// OTLP over http
	TraceReporterType_OTLP_HTTP TraceReporterType = 5
)

func (TraceReporterType) Descriptor

func (TraceReporterType) Enum

func (TraceReporterType) EnumDescriptor deprecated

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

Deprecated: Use TraceReporterType.Descriptor instead.

func (TraceReporterType) Number

func (TraceReporterType) String

func (x TraceReporterType) String() string

func (TraceReporterType) Type

Jump to

Keyboard shortcuts

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