Files
houston-be/model/ingester/performance_metrics.go
Vijay Joshi 2eba625b0d INFRA-2888 : Added custom metrics on all major flows (#393)
* INFRA-2888 : Added alerts on all major flows

* INFRA-2888 : Remove unnecessary space

* INFRA-2888 : Metric handler

* INFRA-2888 : Review changes

* INFRA-2888 : Build fix

* INFRA-2888 : Code cleanup

* INFRA-2888 : Review comments round 1

* INFRA-2888 : Err msg changes

* INFRA-2888 : task to job in name
2024-03-12 19:56:52 +05:30

81 lines
2.5 KiB
Go

package ingester
type MetricType string
const (
HttpClientRequestMetrics MetricType = "HTTP_CLIENT_REQUEST_METRICS"
WebSocketEventMetrics MetricType = "WEBSOCKET_EVENT_METRICS"
HttpServerRequestMetrics MetricType = "HTTP_SERVER_REQUEST_METRICS"
CronJobExecutionCounterMetrics MetricType = "CRON_JOB_METRICS"
CronJobFailureMetrics MetricType = "CRON_JOB_FAILURE_METRICS"
HoustonFlowFailureMetrics MetricType = "HOUSTON_FLOW_FAILURE_METRICS"
)
type ApiMetric struct {
Url string `json:"url,omitempty"`
Method string `json:"method,omitempty"`
ResponseCode int `json:"response_code,omitempty"`
BytesSent int `json:"bytes_sent,omitempty"`
BytesReceived int64 `json:"bytes_received,omitempty"`
StartTime int64 `json:"start_time,omitempty"`
EndTime int64 `json:"end_time,omitempty"`
DurationInMs int64 `json:"duration_in_ms,omitempty"`
ErrorType string `json:"error_type,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
}
type WebSocketEventMetric struct {
EventType string `json:"event_type,omitempty"`
}
type ServerRequestMetric struct {
Url string `json:"url,omitempty"`
Method string `json:"method,omitempty"`
ResponseCode int `json:"response_code,omitempty"`
DurationInMs float64 `json:"duration_in_ms,omitempty"`
}
type CronJobExecutionCounterMetric struct {
JobName string `json:"job_name,omitempty"`
DurationInMs float64 `json:"duration,omitempty"`
}
type CronJobFailureMetric struct {
JobName string `json:"job_name,omitempty"`
Error string `json:"error,omitempty"`
}
type HoustonFlowFailureMetric struct {
FlowName string `json:"flow_name,omitempty"`
Error string `json:"error,omitempty"`
}
type SlackMetric struct {
ChannelName string `json:"channel_id,omitempty"`
ChannelCreationError string `json:"channel_creation_error,omitempty"`
}
type RCAGenerationFailureMetric struct {
IncidentId uint `json:"incident_id,omitempty"`
RCAGenerationError string `json:"rca_generation_error,omitempty"`
}
type KrakatoaWorkflowFailureMetric struct {
IncidentId uint `json:"incident_id,omitempty"`
KrakatoaWorkflowError string `json:"krakatoa_workflow_error,omitempty"`
}
type ConferenceFailureMetric struct {
Event string `json:"event,omitempty"`
ConferenceError string `json:"conference_error,omitempty"`
}
type MetricAttributes struct {
ApiMetric
WebSocketEventMetric
ServerRequestMetric
CronJobExecutionCounterMetric
CronJobFailureMetric
HoustonFlowFailureMetric
}