Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLogEntryMessage ¶
GetLogEntryMessage gets the message body of a LogEntry based on what kind of payload it is If it's JSON, we look for the `message` field since the other fields will be added as labels
func GetLogLabels ¶
GetLogLabels flattens a log entry's labels + resource labels into a map
func GetLogLevel ¶
func GetLogLevel(severity ltype.LogSeverity) string
GetLogLevel maps the string value of a LogSeverity to one supported by Grafana
Types ¶
type API ¶
type API interface {
// ListLogs retrieves all logs matching some query filter up to the given limit
ListLogs(context.Context, *Query) ([]*loggingpb.LogEntry, error)
// TestConnection queries for any log from the given project
TestConnection(ctx context.Context, projectID string) error
// ListProjects returns the project IDs of all visible projects
ListProjects(context.Context) ([]string, error)
// Close closes the underlying connection to the GCP API
Close() error
}
API implements the methods we need to query logs and list projects from GCP
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps a GCP logging client to fetch logs, and a resourcemanager client to list projects
func (*Client) ListLogs ¶
ListLogs retrieves all logs matching some query filter up to the given limit
func (*Client) ListProjects ¶
ListProjects returns the project IDs of all visible projects
Click to show internal directories.
Click to hide internal directories.