Documentation ¶
Overview ¶
Package otellambda instruments the github.com/aws/aws-lambda-go package.
Two wrappers are provided which can be used to instrument Lambda, one for each Lambda entrypoint. Their usages are shown below.
lambda.Start(<user function>) entrypoint: lambda.Start(otellambda.InstrumentHandler(<user function>)) lambda.StartHandler(<user Handler>) entrypoint: lambda.StartHandler(otellambda.WrapHandler(<user Handler>))
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstrumentHandler ¶
func InstrumentHandler(handlerFunc interface{}, options ...Option) interface{}
InstrumentHandler Provides a lambda handler which wraps customer lambda handler with OTel Tracing.
func SemVersion
deprecated
Types ¶
type EventToCarrier ¶
type EventToCarrier func(eventJSON []byte) propagation.TextMapCarrier
An EventToCarrier function defines how the instrumentation should prepare a TextMapCarrier for the configured propagator to read from. This extra step is necessary because Lambda does not have HTTP headers to read from and instead stores the headers it was invoked with (including TraceID, etc.) as part of the invocation event. If using the AWS XRay tracing then the trace information is instead stored in the Lambda environment.
type Flusher ¶
A Flusher dictates how the instrumentation will attempt to flush unexported spans at the end of each Lambda innovation. This is very important in asynchronous settings because the Lambda runtime may enter a 'frozen' state any time after the invocation completes. Should this freeze happen and spans are left unexported, there can be a long delay before those spans are exported.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option applies a configuration option.
func WithEventToCarrier ¶
func WithEventToCarrier(eventToCarrier EventToCarrier) Option
WithEventToCarrier sets the used EventToCarrier.
func WithPropagator ¶
func WithPropagator(propagator propagation.TextMapPropagator) Option
WithPropagator configures the propagator used by the instrumentation.
By default, the global TextMapPropagator will be used.
func WithTracerProvider ¶
func WithTracerProvider(tracerProvider trace.TracerProvider) Option
WithTracerProvider configures the TracerProvider used by the instrumentation.
By default, the global TracerProvider is used.