Documentation ¶
Index ¶
- Constants
- Variables
- func CoderExporter(ctx context.Context) (*otlptrace.Exporter, error)
- func DefaultExporter(ctx context.Context) (*otlptrace.Exporter, error)
- func EndHTTPSpan(r *http.Request, status int, span trace.Span)
- func FuncName() string
- func FuncNameSkip(skip int) string
- func Middleware(tracerProvider trace.TracerProvider) func(http.Handler) http.Handler
- func PostgresDriver(tp trace.TracerProvider, service string) (string, error)
- func StartSpan(ctx context.Context, opts ...trace.SpanStartOption) (context.Context, trace.Span)
- func TracerProvider(ctx context.Context, service string, opts TracerOpts) (*sdktrace.TracerProvider, func(context.Context) error, error)
- type StatusWriter
- type TracerOpts
Constants ¶
View Source
const TracerName = "coderd"
Variables ¶
View Source
var NoopSpan trace.Span
Functions ¶
func CoderExporter ¶ added in v0.9.0
func DefaultExporter ¶ added in v0.9.0
func EndHTTPSpan ¶ added in v0.8.7
EndHTTPSpan captures request and response data after the handler is done.
func FuncNameSkip ¶ added in v0.9.0
func Middleware ¶ added in v0.9.0
Middleware adds tracing to http routes.
func PostgresDriver ¶
func PostgresDriver(tp trace.TracerProvider, service string) (string, error)
Postgres driver will register a new tracing sql driver and return the driver name.
func TracerProvider ¶
func TracerProvider(ctx context.Context, service string, opts TracerOpts) (*sdktrace.TracerProvider, func(context.Context) error, error)
TracerProvider creates a grpc otlp exporter and configures a trace provider. Caller is responsible for calling TracerProvider.Shutdown to ensure all data is flushed.
Types ¶
type StatusWriter ¶ added in v0.9.0
type StatusWriter struct { http.ResponseWriter Status int Hijacked bool // contains filtered or unexported fields }
StatusWriter intercepts the status of the request and the response body up to maxBodySize if Status >= 400. It is guaranteed to be the ResponseWriter directly downstream from Middleware.
func (*StatusWriter) Flush ¶ added in v0.9.0
func (w *StatusWriter) Flush()
func (*StatusWriter) Hijack ¶ added in v0.9.0
func (w *StatusWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
func (*StatusWriter) ResponseBody ¶ added in v0.9.0
func (w *StatusWriter) ResponseBody() []byte
func (*StatusWriter) WriteHeader ¶ added in v0.9.0
func (w *StatusWriter) WriteHeader(status int)
type TracerOpts ¶ added in v0.9.0
type TracerOpts struct { // Default exports to a backend configured by environment variables. See: // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md Default bool // Coder exports traces to Coder's public tracing ingest service and is used // to improve the product. It is disabled when opting out of telemetry. Coder bool }
TracerOpts specifies which telemetry exporters should be configured.
Click to show internal directories.
Click to hide internal directories.