Documentation ¶
Index ¶
- func NewRecord() *xray.TelemetryRecord
- type Config
- type Option
- func ToOptions(cfg Config, sess *session.Session, settings *awsutil.AWSSessionSettings) []Option
- func WithBatchSize(batchSize int) Option
- func WithHostname(hostname string) Option
- func WithInstanceID(instanceID string) Option
- func WithInterval(interval time.Duration) Option
- func WithLogger(logger *zap.Logger) Option
- func WithQueueSize(queueSize int) Option
- func WithResourceARN(resourceARN string) Option
- type Recorder
- type Registry
- type Sender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRecord ¶
func NewRecord() *xray.TelemetryRecord
NewRecord creates a new xray.TelemetryRecord with all of its fields initialized and set to 0.
Types ¶
type Config ¶
type Config struct { // Enabled determines whether any telemetry should be recorded. Enabled bool `mapstructure:"enabled"` // IncludeMetadata determines whether metadata (instance ID, hostname, resourceARN) // should be included in the telemetry. IncludeMetadata bool `mapstructure:"include_metadata"` // Contributors can be used to explicitly define which X-Ray components are contributing to the telemetry. // If omitted, only X-Ray components with the same component.ID as the setup component will have access. Contributors []component.ID `mapstructure:"contributors,omitempty"` // Hostname can be used to explicitly define the hostname associated with the telemetry. Hostname string `mapstructure:"hostname,omitempty"` // InstanceID can be used to explicitly define the instance ID associated with the telemetry. InstanceID string `mapstructure:"instance_id,omitempty"` // ResourceARN can be used to explicitly define the resource ARN associated with the telemetry. ResourceARN string `mapstructure:"resource_arn,omitempty"` }
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithBatchSize ¶
func WithHostname ¶
func WithInstanceID ¶
func WithInterval ¶
func WithLogger ¶
func WithQueueSize ¶
func WithResourceARN ¶
type Recorder ¶
type Recorder interface { // Rotate the current record by swapping it out with a new one. Returns // the rotated record. Rotate() *xray.TelemetryRecord // HasRecording indicates whether any of the record functions were called // with the current record. HasRecording() bool // RecordSegmentsReceived adds the count to the current record. RecordSegmentsReceived(count int) // RecordSegmentsSent adds the count to the current record. RecordSegmentsSent(count int) // RecordSegmentsSpillover adds the count to the current record. RecordSegmentsSpillover(count int) // RecordSegmentsRejected adds the count to the current record. RecordSegmentsRejected(count int) // RecordConnectionError categorizes the error and increments the count by one // for the current record. RecordConnectionError(err error) }
func NewRecorder ¶
func NewRecorder() Recorder
NewRecorder creates a new Recorder with a default interval and queue size.
type Registry ¶
type Registry interface { // Load the Sender for the ID. Load(id component.ID) Sender // LoadOrNop gets the Sender for the ID. If it doesn't exist, returns // the NopSender. LoadOrNop(id component.ID) Sender // LoadOrStore the Sender for the ID. LoadOrStore(id component.ID, sender Sender) (Sender, bool) // Register configures and registers a new Sender for the ID. If one // already exists for the ID, then returns that one instead. Register(id component.ID, cfg Config, client awsxray.XRayClient, opts ...Option) Sender }
Click to show internal directories.
Click to hide internal directories.