Documentation ¶
Index ¶
- Constants
- func InstallNewPipeline(opts []Option, topts ...sdktrace.TracerProviderOption) (trace.TracerProvider, func(), error)
- func NewExportPipeline(opts []Option, topts ...sdktrace.TracerProviderOption) (trace.TracerProvider, func(), error)
- func Version() string
- func WithBufferMaxBytes(bufferMaxBytes int) func(o *options)
- func WithBundleByteLimit(bundleByteLimit int) func(o *options)
- func WithBundleByteThreshold(bundleByteThreshold int) func(o *options)
- func WithBundleCountThreshold(bundleCountThreshold int) func(o *options)
- func WithBundleDelayThreshold(bundleDelayThreshold time.Duration) func(o *options)
- func WithContext(ctx context.Context) func(o *options)
- func WithDisplayNameFormatter(f DisplayNameFormatter) func(o *options)
- func WithMaxNumberOfWorkers(n int) func(o *options)
- func WithMonitoringClientOptions(opts []option.ClientOption) func(o *options)
- func WithOnError(onError func(err error)) func(o *options)
- func WithProjectID(projectID string) func(o *options)
- func WithTimeout(t time.Duration) func(o *options)
- func WithTraceClientOptions(opts []option.ClientOption) func(o *options)
- type DisplayNameFormatter
- type Exporter
- type Option
Constants ¶
const ( // Attributes recorded on the span for the requests. // Only trace exporters will need them. HostAttribute = "http.host" MethodAttribute = "http.method" PathAttribute = "http.path" URLAttribute = "http.url" UserAgentAttribute = "http.user_agent" StatusCodeAttribute = "http.status_code" ServiceAttribute = "service.name" )
Variables ¶
This section is empty.
Functions ¶
func InstallNewPipeline ¶ added in v0.10.0
func InstallNewPipeline(opts []Option, topts ...sdktrace.TracerProviderOption) (trace.TracerProvider, func(), error)
InstallNewPipeline instantiates a NewExportPipeline and registers it globally.
func NewExportPipeline ¶ added in v0.10.0
func NewExportPipeline(opts []Option, topts ...sdktrace.TracerProviderOption) (trace.TracerProvider, func(), error)
NewExportPipeline sets up a complete export pipeline with the recommended setup for trace provider. Returns provider, flush function, and errors.
func Version ¶ added in v0.10.0
func Version() string
Version is the current release version of the OpenTelemetry Operations Trace Exporter in use.
func WithBufferMaxBytes ¶ added in v0.2.1
func WithBufferMaxBytes(bufferMaxBytes int) func(o *options)
WithBufferMaxBytes sets the maximum size (in bytes) of spans that will be buffered in memory before being dropped
func WithBundleByteLimit ¶ added in v0.13.0
func WithBundleByteLimit(bundleByteLimit int) func(o *options)
WithBundleByteLimit sets the maximum size of a bundle, in bytes. Zero means unlimited.
func WithBundleByteThreshold ¶ added in v0.13.0
func WithBundleByteThreshold(bundleByteThreshold int) func(o *options)
WithBundleByteThreshold sets the number of bytes that can be buffered before batch uploading them to the backend.
func WithBundleCountThreshold ¶ added in v0.2.1
func WithBundleCountThreshold(bundleCountThreshold int) func(o *options)
WithBundleCountThreshold sets how many trace spans can be buffered before batch uploading them to the backend.
func WithBundleDelayThreshold ¶ added in v0.2.1
WithBundleDelayThreshold sets the max amount of time the exporter can wait before uploading trace spans to the backend.
func WithContext ¶
WithContext sets the context that trace exporter and metric exporter relies on.
func WithDisplayNameFormatter ¶ added in v0.2.1
func WithDisplayNameFormatter(f DisplayNameFormatter) func(o *options)
WithDisplayNameFormatter sets the way span's display names will be generated from SpanSnapshot
func WithMaxNumberOfWorkers ¶ added in v0.2.1
func WithMaxNumberOfWorkers(n int) func(o *options)
WithMaxNumberOfWorkers sets the number of go routines that send requests to the Cloud Trace backend.
func WithMonitoringClientOptions ¶ added in v0.14.0
func WithMonitoringClientOptions(opts []option.ClientOption) func(o *options)
WithMonitoringClientOptions sets additionial client options for monitoring.
func WithOnError ¶
func WithOnError(onError func(err error)) func(o *options)
WithOnError sets the hook to be called when there is an error occurred on uploading the span data to Stackdriver. If no custom hook is set, errors are logged.
func WithProjectID ¶
func WithProjectID(projectID string) func(o *options)
WithProjectID sets Google Cloud Platform project as projectID. Without using this option, it automatically detects the project ID from the default credential detection process. Please find the detailed order of the default credentail detection proecess on the doc: https://godoc.org/golang.org/x/oauth2/google#FindDefaultCredentials
func WithTimeout ¶
WithTimeout sets the timeout for trace exporter and metric exporter
func WithTraceClientOptions ¶
func WithTraceClientOptions(opts []option.ClientOption) func(o *options)
WithTraceClientOptions sets additionial client options for tracing.
Types ¶
type DisplayNameFormatter ¶ added in v0.2.1
type DisplayNameFormatter func(*export.SpanSnapshot) string
DisplayNameFormatter is is a function that produces the display name of a span given its SpanSnapshot
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter is a trace exporter that uploads data to Stackdriver.
TODO(yoshifumi): add a metrics exporter once the spec definition process and the sampler implementation are done.
func NewExporter ¶
NewExporter creates a new Exporter thats implements trace.Exporter.
TODO(yoshifumi): add a metrics exporter one the spec definition process and the sampler implementation are done.
func (*Exporter) ExportSpans ¶
ExportSpans exports a SpanSnapshot to Stackdriver Trace.