Documentation
¶
Overview ¶
Package glo helps with google cloud logging
Index ¶
- func LogCriticalNoRetry(ev EntryValues, description string, assetType string, ruleName string)
- func LogCriticalRetry(ev EntryValues, description string, assetType string, ruleName string)
- func LogFinish(ev EntryValues, message string, description string, end time.Time, ...)
- func LogInfo(ev EntryValues, message string, description string)
- func LogInitColdStart(ev EntryValues)
- func LogInitDone(ev EntryValues, latencySeconds float64)
- func LogInitFatal(ev EntryValues, description string, err error)
- func LogStartCloudEvent(ev EntryValues, cloudEventJSONBytes []byte, triggeringEventAgeSeconds float64, ...)
- func LogWarning(ev EntryValues, message string, description string)
- type ComonEntryValues
- type Entry
- type EntryValues
- type Step
- type Steps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogCriticalNoRetry ¶
func LogCriticalNoRetry(ev EntryValues, description string, assetType string, ruleName string)
LogCriticalNoRetry logs the critical error before giving up, aka not retry
func LogCriticalRetry ¶
func LogCriticalRetry(ev EntryValues, description string, assetType string, ruleName string)
LogCriticalRetry logs the creitical error before crashing execution, aka asking for a retry
func LogFinish ¶
func LogFinish(ev EntryValues, message string, description string, end time.Time, assetInventoryOrigin string, assetType string, contentType string, ruleName string)
LogFinish logs the end of a successfull execution with data enabling measurement
func LogInfo ¶
func LogInfo(ev EntryValues, message string, description string)
LogInfo logs information
func LogInitColdStart ¶
func LogInitColdStart(ev EntryValues)
LogInitColdStart logs the start of the coldstart actions
func LogInitDone ¶
func LogInitDone(ev EntryValues, latencySeconds float64)
LogInitDone logs sucessfull end of the cold start actions and enables to measure it
func LogInitFatal ¶
func LogInitFatal(ev EntryValues, description string, err error)
LogInitFatal logs a critical error and crashes the init function so that deployment fails
func LogStartCloudEvent ¶
func LogStartCloudEvent(ev EntryValues, cloudEventJSONBytes []byte, triggeringEventAgeSeconds float64, now *time.Time)
LogStartCloudEvent logs the start of the entrypoint function and the triggering cloud event
func LogWarning ¶
func LogWarning(ev EntryValues, message string, description string)
LogWarning logs a non blocking issue
Types ¶
type ComonEntryValues ¶
type ComonEntryValues struct {
Environment string
InitID string
LogOnlySeveritylevels string
MicroserviceName string
}
ComonEntryValues structure used for common value to logging entries
type Entry ¶
type Entry struct {
MicroserviceName string `json:"microservice_name,omitempty"`
InstanceName string `json:"instance_name,omitempty"`
Environment string `json:"environment,omitempty"`
Severity string `json:"severity,omitempty"`
Message string `json:"message"`
Description string `json:"description,omitempty"`
Now *time.Time `json:"now,omitempty"`
Trace string `json:"logging.googleapis.com/trace,omitempty"`
Component string `json:"component,omitempty"`
InitID string `json:"init_id,omitempty"`
TriggeringPubsubID string `json:"triggering_pubsub_id,omitempty"`
TriggeringEventID string `json:"triggering_event_id,omitempty"`
TriggeringPubsubTimestamp *time.Time `json:"triggering_pubsub_timestamp,omitempty"`
TriggeringEventTimestamp *time.Time `json:"triggering_event_timestamp,omitempty"`
TriggeringPubsubAgeSeconds float64 `json:"triggering_pubsub_age_seconds,omitempty"`
TriggeringEventAgeSeconds float64 `json:"triggering_event_age_seconds,omitempty"`
OriginEventID string `json:"origin_event_id,omitempty"`
OriginEventTimestamp *time.Time `json:"origin_event_timestamp,omitempty"`
LatencySeconds float64 `json:"latency_seconds,omitempty"`
LatencyE2ESeconds float64 `json:"latency_e2e_seconds,omitempty"`
LatencyT2SSeconds float64 `json:"latency_t2s_seconds,omitempty"`
StepStack Steps `json:"step_stack,omitempty"`
StepStackLength int `json:"step_stack_length,omitempty"`
Compliant bool `json:"compliant,omitempty"`
AssetInventoryOrigin string `json:"assetInventoryOrigin,omitempty"`
AssetType string `json:"assetType,omitempty"`
ContentType string `json:"contentType,omitempty"`
RuleName string `json:"ruleName,omitempty"`
}
Entry defines a Google Cloud logging structured entry https://cloud.google.com/logging/docs/agent/configuration#special-fields
type EntryValues ¶
type EntryValues struct {
ComonEntryValues ComonEntryValues
Step Step
StepStack Steps
}
EntryValues structure used by logging functions