Documentation ¶
Overview ¶
Package tracespan is a generated protocol buffer package.
TraceSpan represents an individual span within a distributed trace.
When writing the configuration, the value for the fields associated with this template can either be a literal or an [expression](https://istio.io/docs/reference/config/mixer/expression-language.html). Please note that if the datatype of a field is not istio.mixer.adapter.model.v1beta1.Value, then the expression's [inferred type](https://istio.io/docs/reference/config/mixer/expression-language.html#type-checking) must match the datatype of the field.
Example config: ``` apiVersion: "config.istio.io/v1alpha2" kind: tracespan metadata:
name: default namespace: istio-system
spec:
traceId: request.headers["x-b3-traceid"] spanId: request.headers["x-b3-spanid"] | "" parentSpanId: request.headers["x-b3-parentspanid"] | "" spanName: request.path | "/" startTime: request.time endTime: response.time spanTags: http.method: request.method | "" http.status_code: response.code | 200 http.url: request.path | "" request.size: request.size | 0 response.size: response.size | 0 source.ip: source.ip | ip("0.0.0.0") source.service: source.service | "" source.user: source.user | "" source.version: source.labels["version"] | ""
```
See also: [Distributed Tracing](https://istio.io/docs/tasks/telemetry/distributed-tracing.html) for information on tracing within Istio.
It is generated from these files:
mixer/template/tracespan/tracespan_handler_service.proto
It has these top-level messages:
HandleTraceSpanRequest InstanceMsg Type InstanceParam
Index ¶
- Constants
- Variables
- func RegisterHandleTraceSpanServiceServer(s *grpc.Server, srv HandleTraceSpanServiceServer)
- type HandleTraceSpanRequest
- func (*HandleTraceSpanRequest) Descriptor() ([]byte, []int)
- func (m *HandleTraceSpanRequest) Marshal() (dAtA []byte, err error)
- func (m *HandleTraceSpanRequest) MarshalTo(dAtA []byte) (int, error)
- func (*HandleTraceSpanRequest) ProtoMessage()
- func (m *HandleTraceSpanRequest) Reset()
- func (m *HandleTraceSpanRequest) Size() (n int)
- func (this *HandleTraceSpanRequest) String() string
- func (m *HandleTraceSpanRequest) Unmarshal(dAtA []byte) error
- type HandleTraceSpanServiceClient
- type HandleTraceSpanServiceServer
- type Handler
- type HandlerBuilder
- type Instance
- type InstanceMsg
- func (*InstanceMsg) Descriptor() ([]byte, []int)
- func (m *InstanceMsg) Marshal() (dAtA []byte, err error)
- func (m *InstanceMsg) MarshalTo(dAtA []byte) (int, error)
- func (*InstanceMsg) ProtoMessage()
- func (m *InstanceMsg) Reset()
- func (m *InstanceMsg) Size() (n int)
- func (this *InstanceMsg) String() string
- func (m *InstanceMsg) Unmarshal(dAtA []byte) error
- type InstanceParam
- func (*InstanceParam) Descriptor() ([]byte, []int)
- func (m *InstanceParam) Marshal() (dAtA []byte, err error)
- func (m *InstanceParam) MarshalTo(dAtA []byte) (int, error)
- func (*InstanceParam) ProtoMessage()
- func (m *InstanceParam) Reset()
- func (m *InstanceParam) Size() (n int)
- func (this *InstanceParam) String() string
- func (m *InstanceParam) Unmarshal(dAtA []byte) error
- type Type
- func (*Type) Descriptor() ([]byte, []int)
- func (m *Type) Marshal() (dAtA []byte, err error)
- func (m *Type) MarshalTo(dAtA []byte) (int, error)
- func (*Type) ProtoMessage()
- func (m *Type) Reset()
- func (m *Type) Size() (n int)
- func (this *Type) String() string
- func (m *Type) Unmarshal(dAtA []byte) error
Constants ¶
const TemplateName = "tracespan"
Fully qualified name of the template
Variables ¶
var ( ErrInvalidLengthTracespanHandlerService = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTracespanHandlerService = fmt.Errorf("proto: integer overflow") )
Functions ¶
func RegisterHandleTraceSpanServiceServer ¶
func RegisterHandleTraceSpanServiceServer(s *grpc.Server, srv HandleTraceSpanServiceServer)
Types ¶
type HandleTraceSpanRequest ¶
type HandleTraceSpanRequest struct { // 'tracespan' instances. Instances []*InstanceMsg `protobuf:"bytes,1,rep,name=instances" json:"instances,omitempty"` // Adapter specific handler configuration. // // Note: Backends can also implement [InfrastructureBackend][https://istio.io/docs/reference/config/mixer/istio.mixer.adapter.model.v1beta1.html#InfrastructureBackend] // service and therefore opt to receive handler configuration during session creation through [InfrastructureBackend.CreateSession][TODO: Link to this fragment] // call. In that case, adapter_config will have type_url as 'google.protobuf.Any.type_url' and would contain string // value of session_id (returned from InfrastructureBackend.CreateSession). AdapterConfig *google_protobuf1.Any `protobuf:"bytes,2,opt,name=adapter_config,json=adapterConfig" json:"adapter_config,omitempty"` // Id to dedupe identical requests from Mixer. DedupId string `protobuf:"bytes,3,opt,name=dedup_id,json=dedupId,proto3" json:"dedup_id,omitempty"` }
Request message for HandleTraceSpan method.
func (*HandleTraceSpanRequest) Descriptor ¶
func (*HandleTraceSpanRequest) Descriptor() ([]byte, []int)
func (*HandleTraceSpanRequest) Marshal ¶
func (m *HandleTraceSpanRequest) Marshal() (dAtA []byte, err error)
func (*HandleTraceSpanRequest) MarshalTo ¶
func (m *HandleTraceSpanRequest) MarshalTo(dAtA []byte) (int, error)
func (*HandleTraceSpanRequest) ProtoMessage ¶
func (*HandleTraceSpanRequest) ProtoMessage()
func (*HandleTraceSpanRequest) Reset ¶
func (m *HandleTraceSpanRequest) Reset()
func (*HandleTraceSpanRequest) Size ¶
func (m *HandleTraceSpanRequest) Size() (n int)
func (*HandleTraceSpanRequest) String ¶
func (this *HandleTraceSpanRequest) String() string
func (*HandleTraceSpanRequest) Unmarshal ¶
func (m *HandleTraceSpanRequest) Unmarshal(dAtA []byte) error
type HandleTraceSpanServiceClient ¶
type HandleTraceSpanServiceClient interface { // HandleTraceSpan is called by Mixer at request-time to deliver 'tracespan' instances to the backend. HandleTraceSpan(ctx context.Context, in *HandleTraceSpanRequest, opts ...grpc.CallOption) (*istio_mixer_adapter_model_v1beta11.ReportResult, error) }
func NewHandleTraceSpanServiceClient ¶
func NewHandleTraceSpanServiceClient(cc *grpc.ClientConn) HandleTraceSpanServiceClient
type HandleTraceSpanServiceServer ¶
type HandleTraceSpanServiceServer interface { // HandleTraceSpan is called by Mixer at request-time to deliver 'tracespan' instances to the backend. HandleTraceSpan(context.Context, *HandleTraceSpanRequest) (*istio_mixer_adapter_model_v1beta11.ReportResult, error) }
type Handler ¶
type Handler interface { adapter.Handler // HandleTraceSpan is called by Mixer at request time to deliver instances to // to an adapter. HandleTraceSpan(context.Context, []*Instance) error }
Handler must be implemented by adapter code if it wants to process data associated with the 'tracespan' template.
Mixer uses this interface to call into the adapter at request time in order to dispatch created instances to the adapter. Adapters take the incoming instances and do what they need to achieve their primary function.
The name of each instance can be used as a key into the Type map supplied to the adapter at configuration time via the method 'SetTraceSpanTypes'. These Type associated with an instance describes the shape of the instance
type HandlerBuilder ¶
type HandlerBuilder interface { adapter.HandlerBuilder // SetTraceSpanTypes is invoked by Mixer to pass the template-specific Type information for instances that an adapter // may receive at runtime. The type information describes the shape of the instance. SetTraceSpanTypes(map[string]*Type) }
HandlerBuilder must be implemented by adapters if they want to process data associated with the 'tracespan' template.
Mixer uses this interface to call into the adapter at configuration time to configure it with adapter-specific configuration as well as all template-specific type information.
type Instance ¶
type Instance struct { // Name of the instance as specified in configuration. Name string // Trace ID is the unique identifier for a trace. All spans from the same // trace share the same Trace ID. // // Required. TraceId string // Span ID is the unique identifier for a span within a trace. It is assigned // when the span is created. // // Optional. SpanId string // Parent Span ID is the unique identifier for a parent span of this span // instance. If this is a root span, then this field MUST be empty. // // Optional. ParentSpanId string // Span name is a description of the span's operation. // // For example, the name can be a qualified method name or a file name // and a line number where the operation is called. A best practice is to use // the same display name within an application and at the same call point. // This makes it easier to correlate spans in different traces. // // Required. SpanName string // The start time of the span. // // Required. StartTime time.Time // The end time of the span. // // Required. EndTime time.Time // Span tags are a set of <key, value> pairs that provide metadata for the // entire span. The values can be specified in the form of expressions. // // Optional. SpanTags map[string]interface{} }
Instance is constructed by Mixer for the 'tracespan' template.
TraceSpan represents an individual span within a distributed trace.
When writing the configuration, the value for the fields associated with this template can either be a literal or an [expression](https://istio.io/docs/reference/config/mixer/expression-language.html). Please note that if the datatype of a field is not istio.mixer.adapter.model.v1beta1.Value, then the expression's [inferred type](https://istio.io/docs/reference/config/mixer/expression-language.html#type-checking) must match the datatype of the field.
Example config: ``` apiVersion: "config.istio.io/v1alpha2" kind: tracespan metadata:
name: default namespace: istio-system
spec:
traceId: request.headers["x-b3-traceid"] spanId: request.headers["x-b3-spanid"] | "" parentSpanId: request.headers["x-b3-parentspanid"] | "" spanName: request.path | "/" startTime: request.time endTime: response.time spanTags: http.method: request.method | "" http.status_code: response.code | 200 http.url: request.path | "" request.size: request.size | 0 response.size: response.size | 0 source.ip: source.ip | ip("0.0.0.0") source.service: source.service | "" source.user: source.user | "" source.version: source.labels["version"] | ""
```
See also: [Distributed Tracing](https://istio.io/docs/tasks/telemetry/distributed-tracing.html) for information on tracing within Istio.
type InstanceMsg ¶
type InstanceMsg struct { // Name of the instance as specified in configuration. Name string `protobuf:"bytes,72295727,opt,name=name,proto3" json:"name,omitempty"` // Trace ID is the unique identifier for a trace. All spans from the same // trace share the same Trace ID. // // Required. TraceId string `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` // Span ID is the unique identifier for a span within a trace. It is assigned // when the span is created. // // Optional. SpanId string `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` // Parent Span ID is the unique identifier for a parent span of this span // instance. If this is a root span, then this field MUST be empty. // // Optional. ParentSpanId string `protobuf:"bytes,3,opt,name=parent_span_id,json=parentSpanId,proto3" json:"parent_span_id,omitempty"` // Span name is a description of the span's operation. // // For example, the name can be a qualified method name or a file name // and a line number where the operation is called. A best practice is to use // the same display name within an application and at the same call point. // This makes it easier to correlate spans in different traces. // // Required. SpanName string `protobuf:"bytes,4,opt,name=span_name,json=spanName,proto3" json:"span_name,omitempty"` // The start time of the span. // // Required. StartTime *istio_mixer_adapter_model_v1beta12.TimeStamp `protobuf:"bytes,5,opt,name=start_time,json=startTime" json:"start_time,omitempty"` // The end time of the span. // // Required. EndTime *istio_mixer_adapter_model_v1beta12.TimeStamp `protobuf:"bytes,6,opt,name=end_time,json=endTime" json:"end_time,omitempty"` // Span tags are a set of <key, value> pairs that provide metadata for the // entire span. The values can be specified in the form of expressions. // // Optional. SpanTags map[string]*istio_mixer_adapter_model_v1beta12.Value `` /* 159-byte string literal not displayed */ }
Contains instance payload for 'tracespan' template. This is passed to infrastructure backends during request-time through HandleTraceSpanService.HandleTraceSpan.
func (*InstanceMsg) Descriptor ¶
func (*InstanceMsg) Descriptor() ([]byte, []int)
func (*InstanceMsg) Marshal ¶
func (m *InstanceMsg) Marshal() (dAtA []byte, err error)
func (*InstanceMsg) ProtoMessage ¶
func (*InstanceMsg) ProtoMessage()
func (*InstanceMsg) Reset ¶
func (m *InstanceMsg) Reset()
func (*InstanceMsg) Size ¶
func (m *InstanceMsg) Size() (n int)
func (*InstanceMsg) String ¶
func (this *InstanceMsg) String() string
func (*InstanceMsg) Unmarshal ¶
func (m *InstanceMsg) Unmarshal(dAtA []byte) error
type InstanceParam ¶
type InstanceParam struct { // Trace ID is the unique identifier for a trace. All spans from the same // trace share the same Trace ID. // // Required. TraceId string `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` // Span ID is the unique identifier for a span within a trace. It is assigned // when the span is created. // // Optional. SpanId string `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` // Parent Span ID is the unique identifier for a parent span of this span // instance. If this is a root span, then this field MUST be empty. // // Optional. ParentSpanId string `protobuf:"bytes,3,opt,name=parent_span_id,json=parentSpanId,proto3" json:"parent_span_id,omitempty"` // Span name is a description of the span's operation. // // For example, the name can be a qualified method name or a file name // and a line number where the operation is called. A best practice is to use // the same display name within an application and at the same call point. // This makes it easier to correlate spans in different traces. // // Required. SpanName string `protobuf:"bytes,4,opt,name=span_name,json=spanName,proto3" json:"span_name,omitempty"` // The start time of the span. // // Required. StartTime string `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` // The end time of the span. // // Required. EndTime string `protobuf:"bytes,6,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` // Span tags are a set of <key, value> pairs that provide metadata for the // entire span. The values can be specified in the form of expressions. // // Optional. SpanTags map[string]string `` /* 166-byte string literal not displayed */ }
Represents instance configuration schema for 'tracespan' template.
func (*InstanceParam) Descriptor ¶
func (*InstanceParam) Descriptor() ([]byte, []int)
func (*InstanceParam) Marshal ¶
func (m *InstanceParam) Marshal() (dAtA []byte, err error)
func (*InstanceParam) ProtoMessage ¶
func (*InstanceParam) ProtoMessage()
func (*InstanceParam) Reset ¶
func (m *InstanceParam) Reset()
func (*InstanceParam) Size ¶
func (m *InstanceParam) Size() (n int)
func (*InstanceParam) String ¶
func (this *InstanceParam) String() string
func (*InstanceParam) Unmarshal ¶
func (m *InstanceParam) Unmarshal(dAtA []byte) error
type Type ¶
type Type struct { // Span tags are a set of <key, value> pairs that provide metadata for the // entire span. The values can be specified in the form of expressions. // // Optional. SpanTags map[string]istio_policy_v1beta1.ValueType `` /* 203-byte string literal not displayed */ }
Contains inferred type information about specific instance of 'tracespan' template. This is passed to infrastructure backends during configuration-time through [InfrastructureBackend.CreateSession][TODO: Link to this fragment].
func (*Type) Descriptor ¶
func (*Type) ProtoMessage ¶
func (*Type) ProtoMessage()