add_events

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AttrSessionKey     = "session_key"
	AttrServerHost     = "serverHost"
	AttrOrigServerHost = "__origServerHost"
	AttrLogFile        = "logfile"
)

Variables

This section is empty.

Functions

func TrimAttrs

func TrimAttrs(attrs map[string]interface{}, remaining int) map[string]interface{}

TODO document what this function does

Types

type AddEventsRequest

type AddEventsRequest struct {
	request.AuthParams
	AddEventsRequestParams
}

AddEventsRequest represents a AddEvent DataSet REST API request.

type AddEventsRequestParams

type AddEventsRequestParams struct {
	Session     string       `json:"session,omitempty"`
	SessionInfo *SessionInfo `json:"sessionInfo,omitempty"`
	Events      []*Event     `json:"events,omitempty"`
	Threads     []*Thread    `json:"threads,omitempty"`
	Logs        []*Log       `json:"logs,omitempty"`
}

AddEventsRequestParams represents a represents a AddEvent DataSet REST API request parameters, see https://app.scalyr.com/help/api#addEvents.

type AddEventsResponse

type AddEventsResponse struct {
	response.ApiResponse
	BytesCharged int64 `json:"bytesCharged"`
}

AddEventsResponse represents a AddEvent DataSet REST API response.

func (*AddEventsResponse) SetResponseObj

func (response *AddEventsResponse) SetResponseObj(resp *http.Response)

type Event

type Event struct {
	Thread     string     `json:"thread,omitempty"`
	Sev        int        `json:"sev,omitempty"`
	Ts         string     `json:"ts,omitempty"`
	Log        string     `json:"log,omitempty"`
	Attrs      EventAttrs `json:"attrs"`
	ServerHost string     `json:"-"`
}

Event represents DataSet REST API event structure (see https://app.scalyr.com/help/api#addEvents)

func (*Event) CloneWithoutAttrs

func (event *Event) CloneWithoutAttrs() *Event

type EventAttrs added in v0.0.10

type EventAttrs = map[string]interface{}

type EventBundle

type EventBundle struct {
	Event  *Event
	Thread *Thread
	Log    *Log
}

EventBundle represents a single DataSet event wrapper structure (see https://app.scalyr.com/help/api#addEvents) Event - Zero or more events (log messages) to upload. Thread - Optional. Lets you create a readable name for each thread in Event. Log - Optional. Lets you set constant metadata, whose value does not change in multiple events in the request. see also AddEventsRequest which represent full AddEvent DataSet event wrapper structure

type Log

type Log struct {
	Id    string                 `json:"id,omitempty"`
	Attrs map[string]interface{} `json:"attrs"`
}

Log represents a shared attributes reused in multiple Event in EventBundle. This decreases redundant data, and improves throughput.

type SessionInfo

type SessionInfo = map[string]interface{}

type Thread

type Thread struct {
	Id   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

Thread represents a key-value definition of a thread. This lets you create a readable name for each thread used in Event.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL