Documentation
¶
Index ¶
Constants ¶
const ReservedLabelTenantID = "__tenant_id__"
ReservedLabelTenantID reserved to override the tenant ID while processing pipeline stages
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GCPLogEntry ¶
type GCPLogEntry struct {
// why was this here?? nolint:revive
LogName string `json:"logName"`
Resource struct {
Type string `json:"type"`
Labels map[string]string `json:"labels"`
} `json:"resource"`
Timestamp string `json:"timestamp"`
// The time the log entry was received by Logging.
// Its important that `Timestamp` is optional in GCE log entry.
ReceiveTimestamp string `json:"receiveTimestamp"`
// Optional. The severity of the log entry. The default value is DEFAULT.
// DEFAULT, DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY
// https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#LogSeverity
Severity string `json:"severity"`
// Optional. A map of key, value pairs that provides additional information about the log entry.
// The labels can be user-defined or system-defined.
Labels map[string]string `json:"labels"`
TextPayload string `json:"textPayload"`
}
GCPLogEntry that will be written to the pubsub topic according to the following spec. https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics stores gcplog entry metrics.
func NewMetrics ¶
func NewMetrics(reg prometheus.Registerer) *Metrics
NewMetrics creates a new set of metrics. Metrics will be registered to reg.
type PullConfig ¶
type PullConfig struct {
ProjectID string `river:"project_id,attr"`
Subscription string `river:"subscription,attr"`
Labels map[string]string `river:"labels,attr,optional"`
UseIncomingTimestamp bool `river:"use_incoming_timestamp,attr,optional"`
UseFullLine bool `river:"use_full_line,attr,optional"`
}
PullConfig configures a GCPLog target with the 'pull' strategy.
type PullTarget ¶
type PullTarget struct {
// contains filtered or unexported fields
}
PullTarget represents a target that scrapes logs from a GCP project id and subscription and converts them to Loki log entries.
func NewPullTarget ¶
func NewPullTarget(metrics *Metrics, logger log.Logger, handler loki.EntryHandler, jobName string, config *PullConfig, relabel []*relabel.Config, clientOptions ...option.ClientOption) (*PullTarget, error)
NewPullTarget returns the new instance of PullTarget.
func (*PullTarget) Details ¶
func (t *PullTarget) Details() map[string]string
Details returns some debug information about the target.
type PushConfig ¶
type PushConfig struct {
Server *fnet.ServerConfig `river:",squash"`
PushTimeout time.Duration `river:"push_timeout,attr,optional"`
Labels map[string]string `river:"labels,attr,optional"`
UseIncomingTimestamp bool `river:"use_incoming_timestamp,attr,optional"`
UseFullLine bool `river:"use_full_line,attr,optional"`
}
PushConfig configures a GCPLog target with the 'push' strategy.
func (*PushConfig) UnmarshalRiver ¶
func (p *PushConfig) UnmarshalRiver(f func(v interface{}) error) error
UnmarshalRiver implements the unmarshaller
type PushMessage ¶
type PushMessage struct {
Message struct {
Attributes map[string]string `json:"attributes"`
Data string `json:"data"`
ID string `json:"message_id"`
PublishTimestamp string `json:"publish_time"`
} `json:"message"`
Subscription string `json:"subscription"`
}
PushMessage is the POST body format sent by GCP PubSub push subscriptions. See https://cloud.google.com/pubsub/docs/push for details.
type PushTarget ¶
type PushTarget struct {
// contains filtered or unexported fields
}
PushTarget defines a server for receiving messages from a GCP PubSub push subscription.
func NewPushTarget ¶
func NewPushTarget(metrics *Metrics, logger log.Logger, handler loki.EntryHandler, jobName string, config *PushConfig, relabel []*relabel.Config, reg prometheus.Registerer) (*PushTarget, error)
NewPushTarget constructs a PushTarget.
func (*PushTarget) Details ¶
func (p *PushTarget) Details() map[string]string
Details returns some debug information about the target.