Documentation
¶
Overview ¶
Package gitlablogs parses GitLab JSON logs.
Index ¶
Constants ¶
const ( // LogTypePrefix is the prefix of all logs parsed by this package and the name of the log type group LogTypePrefix = "GitLab" // TypeAPI is the type of the GitLabAPI log record TypeAPI = LogTypePrefix + ".API" // TypeAudit is the log type of Audit log records TypeAudit = LogTypePrefix + ".Audit" // TypeExceptions is the log type of Exceptions log records TypeExceptions = LogTypePrefix + ".Exceptions" // TypeGit is the log type of Git log records TypeGit = LogTypePrefix + ".Git" // TypeIntegrations is the log type of GitLabIntegrations TypeIntegrations = LogTypePrefix + ".Integrations" // TypeProduction is the type of the GitLabRails log record TypeProduction = LogTypePrefix + ".Production" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
Time pantherlog.Time `json:"time" event_time:"true" tcodec:"rfc3339" validate:"required" description:"The request timestamp"`
Severity pantherlog.String `json:"severity" validate:"required" description:"The log level"`
DurationSeconds pantherlog.Float32 `json:"duration_s" validate:"required" description:"The time spent serving the request (in seconds)"`
DBDurationSeconds pantherlog.Float32 `json:"db_duration_s" description:"The time spent quering the database (in seconds)"`
ViewDurationSeconds pantherlog.Float32 `json:"view_duration_s" description:"The time spent rendering the view for the Rails controller (in seconds)"`
Status pantherlog.Int16 `json:"status" validate:"required" description:"The HTTP response status code"`
Method pantherlog.String `json:"method" validate:"required" description:"The HTTP method of the request"`
Path pantherlog.String `json:"path" validate:"required" description:"The URL path for the request"`
Params []QueryParam `json:"params" description:"The URL query parameters"`
Host pantherlog.String `json:"host" panther:"hostname" validate:"required" description:"Hostname serving the request"`
UserAgent pantherlog.String `json:"ua" description:"User-Agent HTTP header"`
Route pantherlog.String `json:"route" validate:"required" description:"Rails route for the API endpoint"`
RemoteIP pantherlog.String `json:"remote_ip" panther:"ip" description:"The remote IP address of the HTTP request"`
UserID pantherlog.Int64 `json:"user_id" description:"The user id of the request"`
UserName pantherlog.String `json:"username" panther:"username" description:"The username of the request"`
GitalyCalls pantherlog.Int64 `json:"gitaly_calls" description:"Total number of calls made to Gitaly"`
GitalyDurationSeconds pantherlog.Float32 `json:"gitaly_duration_s" description:"Total time taken by Gitaly calls"`
RedisCalls pantherlog.Int64 `json:"redis_calls" description:"Total number of calls made to Redis"`
RedisDurationSeconds pantherlog.Float32 `json:"redis_duration_s" description:"Total time to retrieve data from Redis"`
CorrelationID pantherlog.String `json:"correlation_id" panther:"trace_id" description:"Request unique id across logs"`
QueueDuration pantherlog.Float32 `json:"queue_duration_s" description:"Total time that the request was queued inside GitLab Workhorse"`
MetaUser pantherlog.String `json:"meta.user" panther:"username" description:"User that invoked the request"`
MetaProject pantherlog.String `json:"meta.project" description:"Project associated with the request"`
MetaRootNamespace pantherlog.String `json:"meta.root_namespace" description:"Root namespace"`
MetaCallerID pantherlog.String `json:"meta.caller_id" description:"Caller ID"`
}
API is a a GitLab log line from an internal API endpoint nolint: lll
type Audit ¶
type Audit struct {
Severity pantherlog.String `json:"severity" validate:"required" description:"The log level"`
Time pantherlog.Time `json:"time" tcodec:"rfc3339" event_time:"true" validate:"required" description:"The event timestamp"`
AuthorID pantherlog.Int64 `json:"author_id" validate:"required" description:"User id that made the change"`
EntityID pantherlog.Int64 `json:"entity_id" validate:"required" description:"Id of the entity that was modified"`
EntityType pantherlog.String `json:"entity_type" validate:"required" description:"Type of the modified entity"`
Change pantherlog.String `json:"change" validate:"required" description:"Type of change to the settings"`
From pantherlog.String `json:"from" validate:"required" description:"Old setting value"`
To pantherlog.String `json:"to" validate:"required" description:"New setting value"`
AuthorName pantherlog.String `json:"author_name" validate:"required" description:"Name of the user that made the change"`
TargetID pantherlog.Int64 `json:"target_id" validate:"required" description:"Target id of the modified setting"`
TargetType pantherlog.String `json:"target_type" validate:"required" description:"Target type of the modified setting"`
TargetDetails pantherlog.String `json:"target_details" validate:"required" description:"Details of the target of the modified setting"`
}
Audit is a a GitLab log line from a failed interaction with git nolint: lll
type Exceptions ¶
type Exceptions struct {
Severity pantherlog.String `json:"severity" validate:"required" description:"The log level"`
Time pantherlog.Time `json:"time" tcodec:"rfc3339" event_time:"true" validate:"required" description:"The event timestamp"`
CorrelationID pantherlog.String `json:"correlation_id" panther:"trace_id" description:"Request unique id across logs"`
ExtraServer *ExtraServer `json:"extra.server" description:"Information about the server on which the exception occurred"`
ExtraProjectID pantherlog.Int64 `json:"extra.project_id" description:"Project id where the exception occurred"`
ExtraRelationKey pantherlog.String `json:"extra.relation_key" description:"Relation on which the exception occurred"`
ExtraRelationIndex pantherlog.Int64 `json:"extra.relation_index" description:"Relation index on which the exception occurred"`
ExceptionClass pantherlog.String `json:"exception.class" validate:"required" description:"Class name of the exception that occurred"`
ExceptionMessage pantherlog.String `json:"exception.message" validate:"required" description:"Message of the exception that occurred"`
ExceptionBacktrace []string `json:"exception.backtrace" description:"Stack trace of the exception that occurred"`
}
Exceptions is a a GitLab log line from a failed interaction with git nolint: lll
type ExtraServer ¶
type ExtraServer struct {
OS *ServerOS `json:"os" validation:"required" description:"Server OS info"`
Runtime *ServerRuntime `json:"runtime" validation:"required" description:"Runtime executing gitlab code"`
}
ExtraServer has info about the server an exception occurred
type Git ¶
type Git struct {
Severity pantherlog.String `json:"severity" validate:"required" description:"The log level"`
Time pantherlog.Time `json:"time" tcodec:"rfc3339" event_time:"true" validate:"required" description:"The event timestamp"`
CorrelationID pantherlog.String `json:"correlation_id" panther:"trace_id" description:"Unique id across logs"`
Message pantherlog.String `json:"message" validate:"required" description:"The error message from git"`
}
Git is a a GitLab log line from a failed interaction with git
type Integrations ¶
type Integrations struct {
Severity pantherlog.String `json:"severity" validate:"required" description:"The log level"`
Time pantherlog.Time `json:"time" tcodec:"rfc3339" event_time:"true" validate:"required" description:"The event timestamp"`
ServiceClass pantherlog.String `json:"service_class" validate:"required" description:"The class name of the integrated service"`
ProjectID pantherlog.Int64 `json:"project_id" validate:"required" description:"The project id the integration was running on"`
ProjectPath pantherlog.String `json:"project_path" validate:"required" description:"The project path the integration was running on"`
Message pantherlog.String `json:"message" validate:"required" description:"The log message from the service"`
ClientURL pantherlog.String `json:"client_url" panther:"url" validate:"required" description:"The client url of the service"`
Error pantherlog.String `json:"error" description:"The error name if an error has occurred"`
}
Integrations is a a GitLab log line from an integrated gitlab activity
type Production ¶ added in v1.4.0
type Production struct {
Method pantherlog.String `json:"method" validate:"required" description:"The HTTP method of the request"`
Path pantherlog.String `json:"path" validate:"required" description:"The URL path for the request"`
Format pantherlog.String `json:"format" description:"The response output format"`
Controller pantherlog.String `json:"controller" description:"The Production controller class name"`
Action pantherlog.String `json:"action" description:"The Production controller action"`
Status pantherlog.Int64 `json:"status" validate:"required" description:"The HTTP response status code"`
Time pantherlog.Time `json:"time" tcodec:"rfc3339" event_time:"true" validate:"required" description:"The request timestamp"`
Params []QueryParam `json:"params" description:"The URL query parameters"`
RemoteIP pantherlog.String `json:"remote_ip" panther:"ip" description:"The remote IP address of the HTTP request"`
UserID pantherlog.Int64 `json:"user_id" description:"The user id of the request"`
UserName pantherlog.String `json:"username" panther:"username" description:"The username of the request"`
UserAgent pantherlog.String `json:"ua" description:"The User-Agent of the requester"`
QueueDurationSeconds pantherlog.Float32 `json:"queue_duration_s" description:"Total time that the request was queued inside GitLab Workhorse"`
GitalyCalls pantherlog.Int64 `json:"gitaly_calls" description:"Total number of calls made to Gitaly"`
GitalyDurationSeconds pantherlog.Float32 `json:"gitaly_duration_s" description:"Total time taken by Gitaly calls"`
RedisCalls pantherlog.Int64 `json:"redis_calls" description:"Total number of calls made to Redis"`
RedisDurationSeconds pantherlog.Float32 `json:"redis_duration_s" description:"Total time to retrieve data from Redis"`
RedisReadBytes pantherlog.Int64 `json:"redis_read_bytes" description:"Total bytes read from Redis"`
RedisWriteBytes pantherlog.Int64 `json:"redis_write_bytes" description:"Total bytes written to Redis"`
CorrelationID pantherlog.String `json:"correlation_id" panther:"trace_id" description:"Request unique id across logs"`
CPUSeconds pantherlog.Float32 `json:"cpu_s" description:" Total time spent on CPU"`
DBDurationSeconds pantherlog.Float32 `json:"db_duration_s" description:"Total time to retrieve data from PostgreSQL"`
ViewDurationSeconds pantherlog.Float32 `json:"view_duration_s" description:" Total time taken inside the Rails views"`
DurationSeconds pantherlog.Float32 `json:"duration_s" validate:"required" description:"Total time taken to retrieve the request"`
MetaCallerID pantherlog.String `json:"meta.caller_id" description:"Caller ID"`
Location pantherlog.String `json:"location" description:"(Applies only to redirects) The redirect URL"`
ExceptionClass pantherlog.String `json:"exception.class" description:"Class name of the exception that occurred"`
ExceptionMessage pantherlog.String `json:"exception.message" description:"Message of the exception that occurred"`
ExceptionBacktrace []string `json:"exception.backtrace" description:"Stack trace of the exception that occurred"`
EtagRoute pantherlog.String `json:"etag_route" description:"Route name etag (on redirects)"`
}
Production is a a GitLab Production controller log line from a non-API endpoint nolint:lll
type QueryParam ¶
type QueryParam struct {
Key pantherlog.String `json:"key" validate:"required" description:"Query parameter name"`
Value pantherlog.RawMessage `json:"value" description:"Query parameter value"`
}
QueryParam is an HTTP query param as logged by LogRage
type ServerOS ¶
type ServerOS struct {
Name pantherlog.String `json:"name" validation:"required" description:"OS name"`
Version pantherlog.String `json:"version" validation:"required" description:"OS version"`
Build pantherlog.String `json:"build" validation:"required" description:"OS build"`
}
ServerOS has info about the OS where an exception occurred
type ServerRuntime ¶
type ServerRuntime struct {
Name pantherlog.String `json:"name" validation:"required" description:"Runtime name"`
Version pantherlog.String `json:"version" validation:"required" description:"Runtime version"`
}
ServerRuntime has info about the runtime where an exception occurred