analytics

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 28 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	Start()
	Close()
	SendRecords(authContext *auth.Context, records []Record) error
}

A Manager wraps all things related to analytics processing

func NewManager

func NewManager(opts Options) (Manager, error)

NewManager constructs and starts a new manager. Call Close when you are done.

type Options

type Options struct {
	// LegacyEndpoint is true if using older direct-submit protocol (opdk)
	LegacyEndpoint bool
	// BufferPath is the directory where the adapter will buffer analytics records.
	BufferPath string
	// StagingFileLimit is the maximum number of files stored in the staging directory.
	// Once this is reached, the oldest files will start being removed.
	StagingFileLimit int
	// Base Apigee URL (legacy saas)
	BaseURL *url.URL
	// Client is a configured HTTPClient
	Client *http.Client
	// SendChannelSize is the size of the records channel
	SendChannelSize int
	// collection interval
	CollectionInterval time.Duration

	// Fluentd endpoint
	FluentdEndpoint string
	// TLSCAFile is fluentd mtls ca file
	TLSCAFile string
	// TLSKeyFile is fluentd mtls key file
	TLSKeyFile string
	// TLSCertFile is fluentd mtls cert file
	TLSCertFile string
	// TLSSkipVerify skips cert verify for fluentd
	TLSSkipVerify bool
	// contains filtered or unexported fields
}

Options allows us to specify options for how this analytics manager will run.

type Record

type Record struct {
	ClientReceivedStartTimestamp int64  `json:"client_received_start_timestamp"`
	ClientReceivedEndTimestamp   int64  `json:"client_received_end_timestamp"`
	TargetSentStartTimestamp     int64  `json:"target_sent_start_timestamp,omitempty"`
	TargetSentEndTimestamp       int64  `json:"target_sent_end_timestamp,omitempty"`
	TargetReceivedStartTimestamp int64  `json:"target_received_start_timestamp,omitempty"`
	TargetReceivedEndTimestamp   int64  `json:"target_received_end_timestamp,omitempty"`
	ClientSentStartTimestamp     int64  `json:"client_sent_start_timestamp"`
	ClientSentEndTimestamp       int64  `json:"client_sent_end_timestamp"`
	RecordType                   string `json:"recordType"`
	APIProxy                     string `json:"apiproxy"`
	RequestURI                   string `json:"request_uri"`
	RequestPath                  string `json:"request_path"`
	RequestVerb                  string `json:"request_verb"`
	ClientIP                     string `json:"client_ip,omitempty"`
	UserAgent                    string `json:"useragent"`
	APIProxyRevision             int    `json:"apiproxy_revision"`
	ResponseStatusCode           int    `json:"response_status_code"`
	DeveloperEmail               string `json:"developer_email,omitempty"`
	DeveloperApp                 string `json:"developer_app,omitempty"`
	AccessToken                  string `json:"access_token,omitempty"`
	ClientID                     string `json:"client_id,omitempty"`
	APIProduct                   string `json:"api_product,omitempty"`
	Organization                 string `json:"organization"`
	Environment                  string `json:"environment"`
	GatewaySource                string `json:"gateway_source"`
	GatewayFlowID                string `json:"gateway_flow_id"`
}

A Record is a single event that is tracked via Apigee analytics.

Jump to

Keyboard shortcuts

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