Documentation ¶
Index ¶
- Constants
- Variables
- func AsyncFinishTraceContext(t TraceContext, endTime time.Time)
- func NewSchedulingTrace(pod *v1.Pod, options ...trace.SpanOption) *schedulingTraceImpl
- func NewTracer(componentName string, cfg *TracerConfiguration) io.Closer
- func SetSpanContextForPod(pod *v1.Pod, spanContext SpanContext)
- func TruncateErrors(errs []error) []error
- func WithBinderOption() trace.SpanOption
- func WithComponent(component string) trace.SpanOption
- func WithDispatcherOption() trace.SpanOption
- func WithE2EExcludedTag(value bool) attribute.KeyValue
- func WithE2ELatency(initialTime time.Time) attribute.KeyValue
- func WithErrorField(err error) attribute.KeyValue
- func WithErrorFields(errs []error) []attribute.KeyValue
- func WithEverScheduledTag(everScheduled bool) trace.SpanOption
- func WithHitCacheTag(result string) attribute.KeyValue
- func WithKeyValue(key string, value interface{}) attribute.KeyValue
- func WithMessageField(message string) attribute.KeyValue
- func WithNodeCircleKey(key string) attribute.KeyValue
- func WithNodeGroupField(nodeGroup string) attribute.KeyValue
- func WithNodeNameField(nodeName string) attribute.KeyValue
- func WithNominatedNodeField(nominatedNode string) attribute.KeyValue
- func WithPlugins(plugins map[string]sets.String) []attribute.KeyValue
- func WithPodKeyField(podKey string) attribute.KeyValue
- func WithPodOwnerField(podOwner string) attribute.KeyValue
- func WithQueueField(queueName string) attribute.KeyValue
- func WithReasonField(reason string) attribute.KeyValue
- func WithResult(result string) trace.SpanOption
- func WithResultTag(value interface{}) attribute.KeyValue
- func WithScheduler(scheduler string) trace.SpanOption
- func WithSchedulerOption() trace.SpanOption
- func WithStartTime(startTime time.Time) trace.SpanOption
- func WithTemplateKeyField(templateKey string) attribute.KeyValue
- func WithVictimPodsField(victims string) attribute.KeyValue
- type NoopSchedulingTrace
- type NoopTracer
- func (tracer *NoopTracer) Close() error
- func (tracer *NoopTracer) Init(componentName, idc, cluster string) error
- func (tracer *NoopTracer) InjectContext(ctx context.Context, span trace.Span, spanContext SpanContext) error
- func (tracer *NoopTracer) StartSpan(ctx context.Context, spanType, spanName string, spanContext SpanContext, ...) (trace.Span, context.Context, error)
- type SchedulingTrace
- type SpanContext
- type SpanInfo
- type TraceContext
- func NewEmptyTraceContext() TraceContext
- func NewTraceContext(ctx context.Context, parentSpanContext SpanContext, span trace.Span) TraceContext
- func StartSpanForPod(podKey, spanName string, options ...trace.SpanOption) (TraceContext, error)
- func StartSpanForPodWithParentSpan(podKey, spanName string, parentSpanContext SpanContext, ...) (TraceContext, error)
- type TraceContextMap
- type TraceContextVal
- type TracerConfig
- type TracerConfiguration
- func (opt *TracerConfiguration) AddFlags(fs *pflag.FlagSet)
- func (opt *TracerConfiguration) ApplyTo(options *TracerConfiguration)
- func (opt *TracerConfiguration) DeepCopy() (out *TracerConfiguration)
- func (opt *TracerConfiguration) DeepCopyInto(out *TracerConfiguration)
- func (opt *TracerConfiguration) Validate() error
Constants ¶
View Source
const ( RootSpan = "rootSpan" SchedulerPendingInQueueSpan = "scheduler::pendingInQueue" SchedulerScheduleSpan = "scheduler::schedule" SchedulerScheduleUnitSpan = "scheduler::scheduleUnit" SchedulerPreemptUnitSpan = "scheduler::preemptUnit" SchedulerSchedulePodSpan = "scheduler::schedulePod" SchedulerPreemptPodSpan = "scheduler::preemptPod" SchedulerGetCachedNodesSpan = "scheduler::getCachedNodes" SchedulerCheckPreferredNodesSpan = "scheduler::checkPreferredNodes" SchedulerFilterSpan = "scheduler::filter" SchedulerPrioritizeSpan = "scheduler::prioritize" SchedulerAssumePodSpan = "scheduler::assume" SchedulerForgetPodSpan = "scheduler::forget" SchedulerUpdatingPodSpan = "scheduler::update" BinderPendingInQueueSpan = "binder::pendingInQueue" BinderAddPodToQueueSpan = "binder::addPodToBinderQueue" BinderUpdatePodToQueueSpan = "binder::updatePodInBinderQueue" BinderDeletePodFromQueueSpan = "binder::deletePodFromBinderQueue" BinderInitializeTaskSpan = "binder::initializeTask" BinderGetReservedResourceSpan = "binder::getReservedResource" BinderCheckPreemptionSpan = "binder::checkPreemption" BinderCheckTopologySpan = "binder::checkTopology" BinderCheckConflictsSpan = "binder::checkConflicts" BinderAssumeTaskSpan = "binder::assumeTask" BinderDeleteVictimsSpan = "binder::deleteVictims" BinderBindTaskSpan = "binder::bindTask" )
View Source
const ( Cluster = "default" IDC = "lq" DefaultSpanType = "GodelScheduler" PodTag = "pod" ClusterTag = "cluster" IDCTag = "idc" ResultTag = "result" QueueTag = "queue" )
View Source
const ( ResultSuccess = "success" ResultFailure = "failure" )
Variables ¶
View Source
var ContextError = fmt.Errorf("unsupported span context")
View Source
var GlobalNoopTracer tracer = newNoopTracer()
View Source
var UnSupportedTracer error = errors.New("unsupported tracer")
Functions ¶
func AsyncFinishTraceContext ¶
func AsyncFinishTraceContext(t TraceContext, endTime time.Time)
func NewSchedulingTrace ¶
func NewSchedulingTrace(pod *v1.Pod, options ...trace.SpanOption) *schedulingTraceImpl
func SetSpanContextForPod ¶
func SetSpanContextForPod(pod *v1.Pod, spanContext SpanContext)
func TruncateErrors ¶
func WithBinderOption ¶
func WithBinderOption() trace.SpanOption
func WithComponent ¶
func WithComponent(component string) trace.SpanOption
func WithDispatcherOption ¶
func WithDispatcherOption() trace.SpanOption
func WithE2EExcludedTag ¶
func WithErrorField ¶
func WithErrorFields ¶
func WithEverScheduledTag ¶
func WithEverScheduledTag(everScheduled bool) trace.SpanOption
func WithHitCacheTag ¶
func WithKeyValue ¶
func WithMessageField ¶
func WithNodeCircleKey ¶
func WithNodeGroupField ¶
func WithNodeNameField ¶
func WithNominatedNodeField ¶
func WithPodKeyField ¶
func WithPodOwnerField ¶
func WithQueueField ¶
func WithReasonField ¶
func WithResult ¶
func WithResult(result string) trace.SpanOption
func WithResultTag ¶
func WithScheduler ¶
func WithScheduler(scheduler string) trace.SpanOption
func WithSchedulerOption ¶
func WithSchedulerOption() trace.SpanOption
func WithStartTime ¶
func WithStartTime(startTime time.Time) trace.SpanOption
func WithTemplateKeyField ¶
func WithVictimPodsField ¶
Types ¶
type NoopSchedulingTrace ¶
type NoopSchedulingTrace struct{}
func (*NoopSchedulingTrace) GetRootSpanContext ¶
func (n *NoopSchedulingTrace) GetRootSpanContext() SpanContext
func (*NoopSchedulingTrace) GetTraceContext ¶
func (n *NoopSchedulingTrace) GetTraceContext(name string) TraceContext
func (*NoopSchedulingTrace) NewTraceContext ¶
func (n *NoopSchedulingTrace) NewTraceContext(parentSpanName, name string, options ...trace.SpanOption) TraceContext
type NoopTracer ¶
type NoopTracer struct {
// contains filtered or unexported fields
}
func (*NoopTracer) Close ¶
func (tracer *NoopTracer) Close() error
func (*NoopTracer) Init ¶
func (tracer *NoopTracer) Init(componentName, idc, cluster string) error
func (*NoopTracer) InjectContext ¶
func (tracer *NoopTracer) InjectContext(ctx context.Context, span trace.Span, spanContext SpanContext) error
func (*NoopTracer) StartSpan ¶
func (tracer *NoopTracer) StartSpan(ctx context.Context, spanType, spanName string, spanContext SpanContext, opts ...trace.SpanOption) (trace.Span, context.Context, error)
type SchedulingTrace ¶
type SchedulingTrace interface { GetRootSpanContext() SpanContext NewTraceContext(parentSpanName, name string, options ...trace.SpanOption) TraceContext GetTraceContext(name string) TraceContext }
type SpanContext ¶
func GetSpanContextFromPod ¶
func GetSpanContextFromPod(pod *v1.Pod) SpanContext
func NewEmptySpanContext ¶
func NewEmptySpanContext() SpanContext
func NewSpanContextFromString ¶
func NewSpanContextFromString(str string) SpanContext
type SpanInfo ¶
type SpanInfo struct {
// contains filtered or unexported fields
}
func NewSpanInfo ¶
func NewSpanInfo(startOptions ...trace.SpanOption) *SpanInfo
func (*SpanInfo) FinishSpan ¶
func (s *SpanInfo) FinishSpan(name string, parentSpanContext SpanContext, startTime time.Time)
func (*SpanInfo) WithFields ¶
func (*SpanInfo) WithTags ¶
func (s *SpanInfo) WithTags(tags ...trace.SpanOption)
type TraceContext ¶
type TraceContext interface { Span() trace.Span SpanContext() SpanContext RootSpanContext() SpanContext WithTags(tags ...attribute.KeyValue) WithFields(fields ...attribute.KeyValue) Finish() FinishWithOptions(opts ...trace.SpanOption) }
func NewEmptyTraceContext ¶
func NewEmptyTraceContext() TraceContext
func NewTraceContext ¶
func NewTraceContext(ctx context.Context, parentSpanContext SpanContext, span trace.Span) TraceContext
func StartSpanForPod ¶
func StartSpanForPod(podKey, spanName string, options ...trace.SpanOption) (TraceContext, error)
func StartSpanForPodWithParentSpan ¶
func StartSpanForPodWithParentSpan(podKey, spanName string, parentSpanContext SpanContext, options ...trace.SpanOption) (TraceContext, error)
StartSpanForPodWithParentSpan creates a span and tracing context of related pod. The new span will be based on spanCtx if it is not empty. If both spanCtx is empty, a root span is created for the pod and return the new tracing context as spanCtx value. The returned value will include the new created span and spanCtx. If root span is created, spanCtx from root span is returned, otherwise returned empty.
type TraceContextMap ¶
type TraceContextVal ¶
type TraceContextVal string
type TracerConfiguration ¶
type TracerConfiguration struct { // IDCName specifies the name of idc to deploy godel dispatcher IDCName *string // ClusterName specifies the name of cluster to serve ClusterName *string // Tracer defines to enable tracing or not Tracer *string }
func DefaultNoopOptions ¶
func DefaultNoopOptions() *TracerConfiguration
func (*TracerConfiguration) AddFlags ¶
func (opt *TracerConfiguration) AddFlags(fs *pflag.FlagSet)
func (*TracerConfiguration) ApplyTo ¶
func (opt *TracerConfiguration) ApplyTo(options *TracerConfiguration)
func (*TracerConfiguration) DeepCopy ¶
func (opt *TracerConfiguration) DeepCopy() (out *TracerConfiguration)
func (*TracerConfiguration) DeepCopyInto ¶
func (opt *TracerConfiguration) DeepCopyInto(out *TracerConfiguration)
func (*TracerConfiguration) Validate ¶
func (opt *TracerConfiguration) Validate() error
Click to show internal directories.
Click to hide internal directories.