awsxray

package module
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AWSOperationAttribute = "aws.operation"
	AWSAccountAttribute   = "aws.account_id"
	AWSRegionAttribute    = "aws.region"
	AWSRequestIDAttribute = "aws.request_id"
	// Currently different instrumentation uses different tag formats.
	// TODO(anuraaga): Find current instrumentation and consolidate.
	AWSRequestIDAttribute2 = "aws.requestId"
	AWSQueueURLAttribute   = "aws.queue_url"
	AWSQueueURLAttribute2  = "aws.queue.url"
	AWSServiceAttribute    = "aws.service"
	AWSTableNameAttribute  = "aws.table_name"
	AWSTableNameAttribute2 = "aws.table.name"

	// AWSXRayInProgressAttribute is the `in_progress` flag in an X-Ray segment
	AWSXRayInProgressAttribute = "aws.xray.inprogress"

	// AWSXRayXForwardedForAttribute is the `x_forwarded_for` flag in an X-Ray segment
	AWSXRayXForwardedForAttribute = "aws.xray.x_forwarded_for"

	// AWSXRayResourceARNAttribute is the `resource_arn` field in an X-Ray segment
	AWSXRayResourceARNAttribute = "aws.xray.resource_arn"

	// AWSXRayTracedAttribute is the `traced` field in an X-Ray subsegment
	AWSXRayTracedAttribute = "aws.xray.traced"

	// AWSXraySegmentMetadataAttributePrefix is the prefix of the attribute that
	// will be treated by the X-Ray exporter as metadata. The key of a metadata
	// will be AWSXraySegmentMetadataAttributePrefix + <metadata_key>.
	AWSXraySegmentMetadataAttributePrefix = "aws.xray.metadata."

	// AWSXrayRetriesAttribute is the `retries` field in an X-Ray (sub)segment.
	AWSXrayRetriesAttribute = "aws.xray.retries"

	// AWSXrayExceptionIDAttribute is the `id` field in an exception
	AWSXrayExceptionIDAttribute = "aws.xray.exception.id"
	// AWSXrayExceptionRemoteAttribute is the `remote` field in an exception
	AWSXrayExceptionRemoteAttribute = "aws.xray.exception.remote"
	// AWSXrayExceptionTruncatedAttribute is the `truncated` field in an exception
	AWSXrayExceptionTruncatedAttribute = "aws.xray.exception.truncated"
	// AWSXrayExceptionSkippedAttribute is the `skipped` field in an exception
	AWSXrayExceptionSkippedAttribute = "aws.xray.exception.skipped"
	// AWSXrayExceptionCauseAttribute is the `cause` field in an exception
	AWSXrayExceptionCauseAttribute = "aws.xray.exception.cause"
)

AWS-specific OpenTelemetry attribute names

View Source
const (
	// TypeStr is the type and ingest format of this receiver
	TypeStr = "awsxray"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSData

type AWSData struct {
	// Segment-only
	Beanstalk *BeanstalkMetadata `json:"elastic_beanstalk,omitempty"`
	ECS       *ECSMetadata       `json:"ecs,omitempty"`
	EC2       *EC2Metadata       `json:"ec2,omitempty"`
	XRay      *XRayMetaData      `json:"xray,omitempty"`

	// For both segment and subsegments
	AccountID    *string `json:"account_id,omitempty"`
	Operation    *string `json:"operation,omitempty"`
	RemoteRegion *string `json:"region,omitempty"`
	RequestID    *string `json:"request_id,omitempty"`
	QueueURL     *string `json:"queue_url,omitempty"`
	TableName    *string `json:"table_name,omitempty"`
	Retries      *int64  `json:"retries,omitempty"`
}

AWSData represents the aws resource that this segment originates from

type BeanstalkMetadata

type BeanstalkMetadata struct {
	Environment  *string `json:"environment_name"`
	VersionLabel *string `json:"version_label"`
	DeploymentID *int64  `json:"deployment_id"`
}

BeanstalkMetadata represents the Elastic Beanstalk environment metadata field

type CauseData

type CauseData struct {
	Type CauseType `json:"-"`
	// it will contain one of ExceptionID or (WorkingDirectory, Paths, Exceptions)
	ExceptionID *string `json:"-"`

	CauseObject
}

CauseData is the container that contains the `cause` field

func (*CauseData) UnmarshalJSON

func (c *CauseData) UnmarshalJSON(data []byte) error

UnmarshalJSON is the custom unmarshaller for the cause field

type CauseObject

type CauseObject struct {
	WorkingDirectory *string     `json:"working_directory,omitempty"`
	Paths            []string    `json:"paths,omitempty"`
	Exceptions       []Exception `json:"exceptions,omitempty"`
}

type CauseType

type CauseType int
const (
	// CauseTypeExceptionID indicates that the type of the `cause`
	// field is a string
	CauseTypeExceptionID CauseType = iota + 1
	// CauseTypeObject indicates that the type of the `cause`
	// field is an object
	CauseTypeObject
)

type EC2Data

type EC2Data struct {
	InstanceID       *string `json:"instance_id"`
	AvailabilityZone *string `json:"availability_zone"`
}

EC2Data provides the shape for unmarshalling the ec2 field.

type EC2Metadata

type EC2Metadata struct {
	InstanceID       *string `json:"instance_id"`
	AvailabilityZone *string `json:"availability_zone"`
	InstanceSize     *string `json:"instance_size"`
	AmiID            *string `json:"ami_id"`
}

EC2Metadata represents the EC2 metadata field

type ECSData

type ECSData struct {
	Container *string `json:"container"`
}

ECSData provides the shape for unmarshalling the ecs field.

type ECSMetadata

type ECSMetadata struct {
	ContainerName *string `json:"container"`
}

ECSMetadata represents the ECS metadata field

type ElasticBeanstalkData

type ElasticBeanstalkData struct {
	EnvironmentName *string `json:"environment_name"`
	VersionLabel    *string `json:"version_label"`
	DeploymentID    *int    `json:"deployment_id"`
}

ElasticBeanstalkData provides the shape for unmarshalling the elastic_beanstalk field.

type Exception

type Exception struct {
	ID        *string      `json:"id,omitempty"`
	Message   *string      `json:"message,omitempty"`
	Type      *string      `json:"type,omitempty"`
	Remote    *bool        `json:"remote,omitempty"`
	Truncated *int64       `json:"truncated,omitempty"`
	Skipped   *int64       `json:"skipped,omitempty"`
	Cause     *string      `json:"cause,omitempty"`
	Stack     []StackFrame `json:"stack,omitempty"`
}

Exception represents an exception occurred

type HTTPData

type HTTPData struct {
	Request  *RequestData  `json:"request,omitempty"`
	Response *ResponseData `json:"response,omitempty"`
}

HTTPData provides the shape for unmarshalling request and response fields.

type RequestData

type RequestData struct {
	// Available in segment
	XForwardedFor *bool `json:"x_forwarded_for,omitempty"`

	// Available in both segment and subsegments
	Method    *string `json:"method,omitempty"`
	URL       *string `json:"url,omitempty"`
	UserAgent *string `json:"user_agent,omitempty"`
	ClientIP  *string `json:"client_ip,omitempty"`
}

RequestData provides the shape for unmarshalling the request field.

type ResponseData

type ResponseData struct {
	Status        *int64 `json:"status,omitempty"`
	ContentLength *int64 `json:"content_length,omitempty"`
}

ResponseData provides the shape for unmarshalling the response field.

type SQLData

type SQLData struct {
	ConnectionString *string `json:"connection_string,omitempty"`
	URL              *string `json:"url,omitempty"` // protocol://host[:port]/database
	SanitizedQuery   *string `json:"sanitized_query,omitempty"`
	DatabaseType     *string `json:"database_type,omitempty"`
	DatabaseVersion  *string `json:"database_version,omitempty"`
	DriverVersion    *string `json:"driver_version,omitempty"`
	User             *string `json:"user,omitempty"`
	Preparation      *string `json:"preparation,omitempty"` // "statement" / "call"
}

SQLData provides the shape for unmarshalling the sql field.

type Segment

type Segment struct {
	// Required fields for both segment and subsegments
	Name      *string  `json:"name"`
	ID        *string  `json:"id"`
	StartTime *float64 `json:"start_time"`

	// Segment-only optional fields
	Service     *ServiceData `json:"service,omitempty"`
	Origin      *string      `json:"origin,omitempty"`
	User        *string      `json:"user,omitempty"`
	ResourceARN *string      `json:"resource_arn,omitempty"`

	// Optional fields for both Segment and subsegments
	TraceID     *string                           `json:"trace_id,omitempty"`
	EndTime     *float64                          `json:"end_time,omitempty"`
	InProgress  *bool                             `json:"in_progress,omitempty"`
	HTTP        *HTTPData                         `json:"http,omitempty"`
	Fault       *bool                             `json:"fault,omitempty"`
	Error       *bool                             `json:"error,omitempty"`
	Throttle    *bool                             `json:"throttle,omitempty"`
	Cause       *CauseData                        `json:"cause,omitempty"`
	AWS         *AWSData                          `json:"aws,omitempty"`
	Annotations map[string]interface{}            `json:"annotations,omitempty"`
	Metadata    map[string]map[string]interface{} `json:"metadata,omitempty"`
	Subsegments []Segment                         `json:"subsegments,omitempty"`

	// (for both embedded and independent) subsegment-only (optional) fields.
	// Please refer to https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html#api-segmentdocuments-subsegments
	// for more information on subsegment.
	Namespace    *string  `json:"namespace,omitempty"`
	ParentID     *string  `json:"parent_id,omitempty"`
	Type         *string  `json:"type,omitempty"`
	PrecursorIDs []string `json:"precursor_ids,omitempty"`
	Traced       *bool    `json:"traced,omitempty"`
	SQL          *SQLData `json:"sql,omitempty"`
}

Segment schema is documented in xray-segmentdocument-schema-v1.0.0 listed on https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html

func (*Segment) Validate

func (s *Segment) Validate() error

Validate checks whether the segment is valid or not

type ServiceData

type ServiceData struct {
	Version         *string `json:"version,omitempty"`
	CompilerVersion *string `json:"compiler_version,omitempty"`
	Compiler        *string `json:"compiler,omitempty"`
}

ServiceData provides the shape for unmarshalling the service field.

type StackFrame

type StackFrame struct {
	Path  *string `json:"path,omitempty"`
	Line  *int    `json:"line,omitempty"`
	Label *string `json:"label,omitempty"`
}

StackFrame represents a frame in the stack when an exception occurred

type XRayMetaData

type XRayMetaData struct {
	SDK                 *string `json:"sdk,omitempty"`
	SDKVersion          *string `json:"sdk_version,omitempty"`
	AutoInstrumentation *bool   `json:"auto_instrumentation"`
}

XRayMetaData provides the shape for unmarshalling the xray field

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL