Documentation
¶
Index ¶
- Constants
- func FormatAPIName(apiName, apiVersionName string) string
- func FormatLeg0(id string) string
- func FormatLeg1(id string) string
- func NewBeater(_ *beat.Beat, _ *common.Config) (beat.Beater, error)
- type Agent
- type Emitter
- type EventMapper
- type EventProcessor
- type GwTrafficLogEntry
- type GwTransaction
- type Headers
- type Mapper
- type MuleEventEmitter
- type MuleEventEmitterJob
- type Processor
Constants ¶
const Backend = "Backend"
const (
CacheKeyTimeStamp = "LAST_RUN"
)
const Client = "Client"
const Inbound = "Inbound"
const MuleProxy = "Mule.APIProxy"
const Outbound = "Outbound"
Variables ¶
This section is empty.
Functions ¶
func FormatAPIName ¶
FormatAPIName formats the name for the api that generated the event
func FormatLeg0 ¶
func FormatLeg1 ¶
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent - mulesoft Beater configuration. Implements the beat.Beater interface.
type Emitter ¶
type Emitter interface { Start() error OnConfigChange(gatewayCfg *config.AgentConfig) }
type EventMapper ¶
type EventMapper struct {
// contains filtered or unexported fields
}
EventMapper -
func NewEventMapper ¶ added in v1.1.47
func NewEventMapper(client anypoint.AnalyticsClient, centralCfg config.CentralConfig) *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 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.