server

package
v0.0.0-...-929b3d6 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version string
	Commit  string
)

Functions

func AnyString

func AnyString(s string) *commonv1.AnyValue

Convert a string to the AnyValue type used in opentelemetry

func Base64

func Base64(b []byte) string

func DeBase64

func DeBase64(s string) []byte

Decode a Base64 string into bytes

func DeHex

func DeHex(s string) []byte

Decode an hex string into bytes

func Hex

func Hex(b []byte) string

func InitServer

func InitServer()

func Kv

func Kv(d map[string]string) []*commonv1.KeyValue

Create a KeyValue array from a map[string]string

func PrintVersion

func PrintVersion()

func Run

func Run()

Types

type ConfigModel

type ConfigModel struct {
	// IP address the gRPC server should bind to
	GrpcListeningAddress string `mapstructure:"GRPC_LISTENING_ADDRESS"`
	// Port number the gRPC server should bind to
	GrpcListeningPort int `mapstructure:"GRPC_LISTENING_PORT"`
	// Snooze URL to send alerts to. Will use the
	// path <url>/api/alerts to send alerts
	SnoozeUrl string `mapstructure:"SNOOZE_URL"`
	// Path to a pem formatted certificate authority when
	// communicating with the snooze server in HTTPS
	SnoozeCaPath string `mapstructure:"SNOOZE_CA_PATH"`
	// A logrus log level (trace/debug/info/warning/error/fatal/panic).
	LogLevel string `mapstructure:"LOG_LEVEL"`
	// Whether to enable prometheus metrics
	PrometheusEnable bool `mapstructure:"PROMETHEUS_ENABLE"`
	// Port the prometheus exporter should listen to
	PrometheusPort int `mapstructure:"PROMETHEUS_PORT"`
}
var Config ConfigModel

type SnoozeAlertV1

type SnoozeAlertV1 struct {
	Source           string            `json:"source"`
	Timestamp        string            `json:"timestamp"`
	Host             string            `json:"host"`
	Process          string            `json:"process"`
	Severity         string            `json:"severity"`
	ExceptionType    string            `json:"exception_type,omitempty"`
	ExceptionMessage string            `json:"exception_message,omitempty"`
	ExceptionStack   string            `json:"exception_trace,omitempty"`
	Message          string            `json:"message"`
	Attributes       map[string]string `json:"attributes"`
}

type SnoozeClient

type SnoozeClient struct {
	// contains filtered or unexported fields
}
var Snooze SnoozeClient

Jump to

Keyboard shortcuts

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