aws

package
v0.0.0-...-3dcf009 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogGroups

func GetLogGroups(ctx context.Context) ([]string, error)

Types

type LogData

type LogData struct {
	Results *cloudwatchlogs.GetQueryResultsOutput
}

func FetchLogs

func FetchLogs(ctx context.Context, queryID LogQueryID) (*LogData, error)

func (LogData) IsEmpty

func (l LogData) IsEmpty() bool

type LogQueryID

type LogQueryID string

func StartLogsQuery

func StartLogsQuery(ctx context.Context, logGroupNames []string, id TraceID) (*LogQueryID, error)

type SQL

type SQL struct {
	ConnectionString string `json:"connection_string"`
	URL              string `json:"url"`
	SanitizedQuery   string `json:"sanitized_query"`
	DatabaseType     string `json:"database_type"`
	User             string `json:"user"`
}

type Segment

type Segment struct {
	// Required fields
	//
	Name string `json:"name"`
	ID   string `json:"id"`

	StartTime Time `json:"start_time"`
	EndTime   Time `json:"end_time"`

	TraceID string `json:"trace_id"`

	// Optional fields
	//
	Service     map[string]any `json:"service,omitempty"`
	User        map[string]any `json:"user,omitempty"`
	Origin      string         `json:"origin,omitempty"`
	ParentID    string         `json:"parent_id,omitempty"`
	HTTP        SegmentHTTP    `json:"http,omitempty"`
	Aws         SegmentAWS     `json:"aws,omitempty"`
	Error       bool           `json:"error,omitempty"`
	Throttle    bool           `json:"throttle,omitempty"`
	Fault       bool           `json:"fault,omitempty"`
	Cause       any            `json:"cause,omitempty"`
	Annotations map[string]any `json:"annotations,omitempty"`
	Metadata    map[string]any `json:"metadata,omitempty"`
	SubSegments []SubSegment   `json:"subsegments,omitempty"`

	// Not part of the schema but found in practice
	SQL mo.Option[SQL] `json:"sql,omitempty"`
}

type SegmentAWS

type SegmentAWS struct {
	Operation string `json:"operation"`
	AccountID string `json:"account_id"`
	Region    string `json:"region"`
	RequestID string `json:"request_id"`
	QueueURL  string `json:"queue_url"`
	TableName string `json:"table_name"`
}

type SegmentHTTP

type SegmentHTTP struct {
	Request  SegmentHTTPRequest  `json:"request,omitempty"`
	Response SegmentHTTPResponse `json:"response,omitempty"`
}

type SegmentHTTPRequest

type SegmentHTTPRequest struct {
	Method        string `json:"method,omitempty"`
	URL           string `json:"url,omitempty"`
	UserAgent     string `json:"user_agent,omitempty"`
	ClientIP      string `json:"client_ip,omitempty"`
	XForwardedFor bool   `json:"x_forwarded_for,omitempty"`
	Traced        bool   `json:"traced,omitempty"`
}

type SegmentHTTPResponse

type SegmentHTTPResponse struct {
	Status        int `json:"status,omitempty"`
	ContentLength int `json:"content_length,omitempty"`
}

type SubSegment

type SubSegment struct {
	// Required fields
	//
	Name string `json:"name"`
	ID   string `json:"id"`

	StartTime Time `json:"start_time"`
	EndTime   Time `json:"end_time"`

	InProgress bool   `json:"in_progress"`
	TraceID    string `json:"trace_id"`
	ParentID   string `json:"parent_id"`

	// Optional fields
	//
	Namespace   string         `json:"namespace,omitempty"`
	HTTP        SegmentHTTP    `json:"http,omitempty"`
	Aws         SegmentAWS     `json:"aws,omitempty"`
	Error       bool           `json:"error,omitempty"`
	Throttle    bool           `json:"throttle,omitempty"`
	Fault       bool           `json:"fault,omitempty"`
	Cause       any            `json:"cause,omitempty"`
	Annotations map[string]any `json:"annotations,omitempty"`
	Metadata    map[string]any `json:"metadata,omitempty"`
	SubSegments []SubSegment   `json:"subsegments,omitempty"`

	// Not part of the schema but found in practice
	SQL mo.Option[SQL] `json:"sql,omitempty"`
}

type SummaryData

type SummaryData struct {
	NextToken mo.Option[string]
	Summaries []TraceSummary
}

func FetchTraceSummaries

func FetchTraceSummaries(
	ctx context.Context,
	nextToken mo.Option[string],
) (*SummaryData, error)

type Time

type Time time.Time

func (Time) Time

func (t Time) Time() time.Time

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

type TraceDetails

type TraceDetails struct {
	ID       TraceID
	Segments []Segment
}

func FetchTraceDetails

func FetchTraceDetails(ctx context.Context, id TraceID) (*TraceDetails, error)

func (TraceDetails) String

func (t TraceDetails) String() string

type TraceID

type TraceID string

type TraceSummary

type TraceSummary struct {
	Data types.TraceSummary
}

func (TraceSummary) FilterValue

func (t TraceSummary) FilterValue() string

func (TraceSummary) HasError

func (t TraceSummary) HasError() bool

func (TraceSummary) HasFault

func (t TraceSummary) HasFault() bool

func (TraceSummary) ID

func (t TraceSummary) ID() string

func (TraceSummary) Path

func (t TraceSummary) Path() string

func (TraceSummary) Title

func (t TraceSummary) Title() string

Jump to

Keyboard shortcuts

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