Documentation
¶
Index ¶
Constants ¶
const ReservedLabelTenantID = "__tenant_id__"
ReservedLabelTenantID reserved to override the tenant ID while processing pipeline stages
Variables ¶
var DefaultPushConfig = PushConfig{
HTTPListenAddress: "0.0.0.0",
HTTPListenPort: 8080,
}
DefaultPushConfig sets the default listen address and port.
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"` 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"` }
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.
func (*PullTarget) Labels ¶
func (t *PullTarget) Labels() model.LabelSet
Labels return the model.LabelSet that the target applies to log entries.
type PushConfig ¶
type PushConfig struct { HTTPListenAddress string `river:"http_listen_address,attr,optional"` HTTPListenPort int `river:"http_listen_port,attr,optional"` PushTimeout time.Duration `river:"push_timeout,attr,optional"` Labels map[string]string `river:"labels,attr,optional"` UseIncomingTimestamp bool `river:"use_incoming_timestamp,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.
func (PushMessage) Validate ¶
func (pm PushMessage) Validate() error
Validate checks that the required fields of a PushMessage are set.
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.
func (*PushTarget) Labels ¶
func (p *PushTarget) Labels() model.LabelSet
Labels return the model.LabelSet that the target applies to log entries.