traceability

package
v1.1.46 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const Backend = "Backend"
View Source
const (
	CacheKeyTimeStamp = "LAST_RUN"
)
View Source
const Client = "Client"
View Source
const Inbound = "Inbound"
View Source
const MuleProxy = "Mule.APIProxy"
View Source
const Outbound = "Outbound"

Variables

This section is empty.

Functions

func FormatAPIName

func FormatAPIName(apiName, apiVersionName string) string

FormatAPIName formats the name for the api that generated the event

func FormatLeg0

func FormatLeg0(id string) string

func FormatLeg1

func FormatLeg1(id string) string

func FormatTxnID

func FormatTxnID(apiVersionID, messageID string) string

func NewBeater

func NewBeater(_ *beat.Beat, _ *common.Config) (beat.Beater, error)

NewBeater creates an instance of mulesoft_traceability_agent.

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

Agent - mulesoft Beater configuration. Implements the beat.Beater interface.

func (*Agent) Run

func (a *Agent) Run(b *beat.Beat) error

Run starts the Mulesoft traceability agent.

func (*Agent) Stop

func (a *Agent) Stop()

Stop stops the agent.

type Emitter

type Emitter interface {
	Start() error
	OnConfigChange(gatewayCfg *config.AgentConfig)
}

type EventMapper

type EventMapper struct {
	// contains filtered or unexported fields
}

EventMapper -

func (*EventMapper) ProcessMapping

func (em *EventMapper) ProcessMapping(event anypoint.AnalyticsEvent) ([]*transaction.LogEvent, error)

type EventProcessor

type EventProcessor struct {
	// contains filtered or unexported fields
}

EventProcessor - represents the processor for received event for Amplify Central The event processing can be done either when the beat input receives the log entry or before the beat transport publishes the event to transport. When processing the received log entry on input, the log entry is mapped to structure expected for Amplify Central Observer and then beat.Event is published to beat output that produces the event over the configured transport. When processing the log entry on output, the log entry is published to output as beat.Event. The output transport invokes the Process(events []publisher.Event) method which is set as output event processor. The Process() method processes the received log entry and performs the mapping to structure expected for Amplify Central Observer. The method returns the converted Events to transport publisher which then produces the events over the transport.

func NewEventProcessor

func NewEventProcessor(
	gateway *config.AgentConfig,
	eventGenerator transaction.EventGenerator,
	mapper Mapper,
) *EventProcessor

func (*EventProcessor) ProcessRaw

func (ep *EventProcessor) ProcessRaw(rawEvent []byte) []beat.Event

ProcessRaw - process the received log entry and returns the event to be published to Amplifyingestion service

type GwTrafficLogEntry

type GwTrafficLogEntry struct {
	APIName             string        `json:"apiName"`
	InboundTransaction  GwTransaction `json:"inbound"`
	OutboundTransaction GwTransaction `json:"outbound"`
	TraceID             string        `json:"traceId"`
}

GwTrafficLogEntry - Represents the structure of log entry the agent will receive

type GwTransaction

type GwTransaction struct {
	DesHost         string  `json:"destHost"`
	DestPort        int     `json:"destPort"`
	ID              string  `json:"id"`
	Method          string  `json:"method"`
	RequestBytes    int     `json:"requestByte"`
	RequestHeaders  Headers `json:"requestHeaders"`
	ResponseBytes   int     `json:"responseByte"`
	ResponseHeaders Headers `json:"responseHeaders"`
	SourceHost      string  `json:"srcHost"`
	SourcePort      int     `json:"srcPort"`
	StatusCode      int     `json:"statusCode"`
	URI             string  `json:"uri"`
}

GwTransaction - Type for gateway transaction detail

type Headers

type Headers map[string]string

Headers - Type for request/response headers

type Mapper

type Mapper interface {
	ProcessMapping(event anypoint.AnalyticsEvent) ([]*transaction.LogEvent, error)
}

type MuleEventEmitter

type MuleEventEmitter struct {
	// contains filtered or unexported fields
}

MuleEventEmitter - Gathers analytics data for publishing to Central.

func NewMuleEventEmitter

func NewMuleEventEmitter(cachePath string, eventChannel chan string, client anypoint.AnalyticsClient) *MuleEventEmitter

NewMuleEventEmitter - Creates a client to poll for events.

func (*MuleEventEmitter) OnConfigChange

func (me *MuleEventEmitter) OnConfigChange(gatewayCfg *config.AgentConfig)

OnConfigChange passes the new config to the client to handle config changes since the MuleEventEmitter only has cache config value references and should not be changed

func (*MuleEventEmitter) Start

func (me *MuleEventEmitter) Start() error

Start retrieves analytics data from anypoint and sends them on the event channel for processing.

type MuleEventEmitterJob

type MuleEventEmitterJob struct {
	Emitter
	// contains filtered or unexported fields
}

MuleEventEmitterJob wraps an Emitter and implements the Job interface so that it can be executed by the sdk.

func NewMuleEventEmitterJob

func NewMuleEventEmitterJob(
	emitter Emitter,
	pollInterval time.Duration,
	checkStatus hc.CheckStatus,
	getStatus func(endpoint string) hc.StatusLevel,
	registerHC healthChecker,
) (*MuleEventEmitterJob, error)

NewMuleEventEmitterJob creates a struct that implements the Emitter and Job interfaces.

func (*MuleEventEmitterJob) Execute

func (m *MuleEventEmitterJob) Execute() error

Execute called by the sdk on each interval.

func (*MuleEventEmitterJob) OnConfigChange

func (m *MuleEventEmitterJob) OnConfigChange(gatewayCfg *config.AgentConfig)

OnConfigChange updates the MuleEventEmitterJob with any config changes, and calls OnConfigChange on the Emitter

func (*MuleEventEmitterJob) Ready

func (m *MuleEventEmitterJob) Ready() bool

Ready determines if the job is ready to run.

func (*MuleEventEmitterJob) Start

func (m *MuleEventEmitterJob) Start() error

Start registers the job with the sdk.

func (*MuleEventEmitterJob) Status

func (m *MuleEventEmitterJob) Status() error

Status Performs a health check for this job before it is executed.

type Processor

type Processor interface {
	ProcessRaw(rawEvent []byte) []beat.Event
}

Jump to

Keyboard shortcuts

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