trace

package
v0.0.0-...-fc6ac2f Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package trace provides utilities for creating and submitting traces in serverless-init

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitSpan

func InitSpan(service, name, resource, spanType string, startTime int64, tags map[string]string) *pb.Span

InitSpan creates a new span with the provided metadata

func SubmitSpan

func SubmitSpan(span *pb.Span, origin string, traceAgent Processor)

SubmitSpan submits a completed span to the trace agent

Types

type CloudRunJobsSpanModifier

type CloudRunJobsSpanModifier struct {
	// contains filtered or unexported fields
}

CloudRunJobsSpanModifier reparents user spans under the Cloud Run Job span.

This modifier adopts the TraceID from the first span seen (regardless of ParentID) and only reparents root spans (ParentID=0). Child spans are left unmodified to preserve the original span hierarchy.

In trace propagation scenarios where all spans have non-zero ParentIDs, the job span will be "floating" (unparented) within the trace. This is an acceptable trade-off as all spans will still share the same TraceID for log-trace correlation.

func NewCloudRunJobsSpanModifier

func NewCloudRunJobsSpanModifier(jobSpan *pb.Span) *CloudRunJobsSpanModifier

NewCloudRunJobsSpanModifier creates a new span modifier for Cloud Run Jobs

func (*CloudRunJobsSpanModifier) ModifySpan

func (m *CloudRunJobsSpanModifier) ModifySpan(_ *pb.TraceChunk, span *pb.Span)

ModifySpan reparents user spans under the Cloud Run Job span

type Processor

type Processor interface {
	Process(*api.Payload)
}

Processor is an interface for processing trace payloads

type SpanModifierSetter

type SpanModifierSetter interface {
	SetSpanModifier(agent.SpanModifier)
}

SpanModifierSetter is an interface for setting span modifiers

Jump to

Keyboard shortcuts

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