Documentation ¶
Overview ¶
Package awsxrayexporter implements an OpenTelemetry Collector exporter that sends trace data to AWS X-Ray in the region the collector is running in using the PutTraceSegments API.
Index ¶
- Constants
- func GetAWSConfigSession(logger *zap.Logger, cn connAttr, cfg *Config) (*aws.Config, *session.Session, error)
- func IsTimeoutError(err error) bool
- func NewTraceExporter(config configmodels.Exporter, logger *zap.Logger, cn connAttr) (component.TraceExporter, error)
- func ProxyServerTransport(logger *zap.Logger, config *Config) (*http.Transport, error)
- type Config
- type Conn
- type Factory
- func (f *Factory) CreateDefaultConfig() configmodels.Exporter
- func (f *Factory) CreateMetricsExporter(_ context.Context, _ component.ExporterCreateParams, _ configmodels.Exporter) (component.MetricsExporter, error)
- func (f *Factory) CreateTraceExporter(_ context.Context, params component.ExporterCreateParams, ...) (component.TraceExporter, error)
- func (f *Factory) Type() configmodels.Type
- type XRay
- type XRayClient
Constants ¶
const ( STSEndpointPrefix = "https://sts." STSEndpointSuffix = ".amazonaws.com" STSAwsCnPartitionIDSuffix = ".amazonaws.com.cn" // AWS China partition. )
AWS STS endpoint constants
Variables ¶
This section is empty.
Functions ¶
func GetAWSConfigSession ¶
func GetAWSConfigSession(logger *zap.Logger, cn connAttr, cfg *Config) (*aws.Config, *session.Session, error)
GetAWSConfigSession returns AWS config and session instances.
func IsTimeoutError ¶
IsTimeoutError checks whether error is timeout error.
func NewTraceExporter ¶
func NewTraceExporter(config configmodels.Exporter, logger *zap.Logger, cn connAttr) (component.TraceExporter, error)
NewTraceExporter creates an component.TraceExporterOld that converts to an X-Ray PutTraceSegments request and then posts the request to the configured region's X-Ray endpoint.
Types ¶
type Config ¶
type Config struct { configmodels.ExporterSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct. // Maximum number of concurrent calls to AWS X-Ray to upload documents. NumberOfWorkers int `mapstructure:"num_workers"` // X-Ray service endpoint to which the collector sends segment documents. Endpoint string `mapstructure:"endpoint"` // Number of seconds before timing out a request. RequestTimeoutSeconds int `mapstructure:"request_timeout_seconds"` // Maximum number of retries before abandoning an attempt to post data. MaxRetries int `mapstructure:"max_retries"` // Enable or disable TLS certificate verification. NoVerifySSL bool `mapstructure:"no_verify_ssl"` // Upload segments to AWS X-Ray through a proxy. ProxyAddress string `mapstructure:"proxy_address"` // Send segments to AWS X-Ray service in a specific region. Region string `mapstructure:"region"` // Local mode to skip EC2 instance metadata check. LocalMode bool `mapstructure:"local_mode"` // Amazon Resource Name (ARN) of the AWS resource running the collector. ResourceARN string `mapstructure:"resource_arn"` // IAM role to upload segments to a different account. RoleARN string `mapstructure:"role_arn"` }
Config defines configuration for AWS X-Ray exporter.
type Factory ¶
type Factory struct { }
Factory is the factory for AWS X-Ray exporter.
func (*Factory) CreateDefaultConfig ¶
func (f *Factory) CreateDefaultConfig() configmodels.Exporter
CreateDefaultConfig creates the default configuration for exporter.
func (*Factory) CreateMetricsExporter ¶
func (f *Factory) CreateMetricsExporter( _ context.Context, _ component.ExporterCreateParams, _ configmodels.Exporter, ) (component.MetricsExporter, error)
CreateMetricsExporter always returns nil.
func (*Factory) CreateTraceExporter ¶
func (f *Factory) CreateTraceExporter( _ context.Context, params component.ExporterCreateParams, cfg configmodels.Exporter, ) (component.TraceExporter, error)
CreateTraceExporter creates a trace exporter based on this config.
func (*Factory) Type ¶
func (f *Factory) Type() configmodels.Type
Type gets the type of the Exporter config created by this factory.
type XRay ¶
type XRay interface { PutTraceSegments(input *xray.PutTraceSegmentsInput) (*xray.PutTraceSegmentsOutput, error) PutTelemetryRecords(input *xray.PutTelemetryRecordsInput) (*xray.PutTelemetryRecordsOutput, error) }
XRay defines X-Ray api call structure.
type XRayClient ¶
type XRayClient struct {
// contains filtered or unexported fields
}
XRayClient represents X-Ray client.
func (*XRayClient) PutTelemetryRecords ¶
func (c *XRayClient) PutTelemetryRecords(input *xray.PutTelemetryRecordsInput) (*xray.PutTelemetryRecordsOutput, error)
PutTelemetryRecords makes PutTelemetryRecords api call on X-Ray client.
func (*XRayClient) PutTraceSegments ¶
func (c *XRayClient) PutTraceSegments(input *xray.PutTraceSegmentsInput) (*xray.PutTraceSegmentsOutput, error)
PutTraceSegments makes PutTraceSegments api call on X-Ray client.