Documentation ¶
Index ¶
- Constants
- func ValidateTagName(tagName string) string
- type CronitorApi
- func (api CronitorApi) MakeAndSendTelemetryJobEventAndLogs(event *pkg.JobEvent, logs string, pod *corev1.Pod, job *v1.Job, ...) error
- func (api CronitorApi) MakeAndSendTelemetryPodEventAndLogs(event *pkg.PodEvent, logs string, pod *corev1.Pod, job *v1.Job, ...) error
- func (api CronitorApi) PutCronJob(cronJob *v1.CronJob) ([]*lib.Monitor, error)
- func (api CronitorApi) PutCronJobs(cronJobs []*v1.CronJob) ([]*lib.Monitor, error)
- func (api CronitorApi) ShipLogData(params *TelemetryEvent) ([]byte, error)
- type CronitorApiError
- type CronitorJob
- type TelemetryEvent
- type TelemetryEventStatus
Constants ¶
View Source
const LogsTruncationLength = 2000
Variables ¶
This section is empty.
Functions ¶
func ValidateTagName ¶
Types ¶
type CronitorApi ¶
Temporarily borrowed from https://github.com/cronitorio/cronitor-cli/blob/a5e2b681c89ff8fd5803551206d7ce9674122bd1/lib/cronitor.go#L44
func NewCronitorApi ¶
func NewCronitorApi(apikey string, dryRun bool) CronitorApi
func (CronitorApi) MakeAndSendTelemetryJobEventAndLogs ¶
func (CronitorApi) MakeAndSendTelemetryPodEventAndLogs ¶
func (CronitorApi) PutCronJob ¶
func (CronitorApi) PutCronJobs ¶
func (CronitorApi) ShipLogData ¶
func (api CronitorApi) ShipLogData(params *TelemetryEvent) ([]byte, error)
type CronitorApiError ¶
func (CronitorApiError) Error ¶
func (c CronitorApiError) Error() string
func (CronitorApiError) ResponseBody ¶
func (c CronitorApiError) ResponseBody() ([]byte, error)
func (*CronitorApiError) Unwrap ¶
func (c *CronitorApiError) Unwrap() error
type CronitorJob ¶
type CronitorJob struct { Key string `json:"key"` Name string `json:"name,omitempty"` DefaultNote string `json:"defaultNote,omitempty"` Metadata string `json:"metadata"` // This is actually a string rather than a map Type_ string `json:"type"` // 'job' Schedule string `json:"schedule"` Tags []string `json:"tags,omitempty"` Notify []string `json:"notify,omitempty"` Group string `json:"group,omitempty"` GraceSeconds int `json:"grace_seconds,omitempty"` }
func (CronitorJob) GetEnvironment ¶
func (cronitorJob CronitorJob) GetEnvironment() string
type TelemetryEvent ¶
type TelemetryEvent struct { CronJob *v1.CronJob Event TelemetryEventStatus Message string ErrorLogs string // Timestamp in seconds with 3 decimal places for microsecond Timestamp string // Series is a UUID to distinguish different sets of pings in a series. // In Kubernetes, this is loosely analogous to a Job instance of a CronJob, so we use the // Job's UUID, which will stay stable even on multiple pod retries. Series *types.UID ExitCode *int Env string // Host is the Kubernetes node that the pod is running on Host string Metric string }
func (TelemetryEvent) CreateLogTelemetryEvent ¶
func (t TelemetryEvent) CreateLogTelemetryEvent() *TelemetryEvent
func (TelemetryEvent) Encode ¶
func (t TelemetryEvent) Encode() string
type TelemetryEventStatus ¶
type TelemetryEventStatus string
const ( Run TelemetryEventStatus = "run" Complete TelemetryEventStatus = "complete" Fail TelemetryEventStatus = "fail" Ok TelemetryEventStatus = "ok" Logs TelemetryEventStatus = "logs" )
func TranslatePodEventReasonToTelemetryEventStatus ¶
func TranslatePodEventReasonToTelemetryEventStatus(event *pkg.PodEvent) (*TelemetryEventStatus, error)
Click to show internal directories.
Click to hide internal directories.