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 NewFactory() component.ExporterFactory
- 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 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 NewFactory ¶ added in v0.7.0
func NewFactory() component.ExporterFactory
NewFactory creates a factory for AWS-Xray exporter.
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"` // By default, OpenTelemetry attributes are converted to X-Ray metadata, which are not indexed. // Specify a list of attribute names to be converted to X-Ray annotations instead, which will be indexed. // See annotation vs. metadata: https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-annotations IndexedAttributes []string `mapstructure:"indexed_attributes"` // Set to true to convert all OpenTelemetry attributes to X-Ray annotation (indexed) ignoring the IndexedAttributes option. // Default value: false IndexAllAttributes bool `mapstructure:"index_all_attributes"` }
Config defines configuration for AWS X-Ray exporter.
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.