model

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtendedFAAS

type ExtendedFAAS struct {
	ID        string `json:"id,omitempty"`
	Execution string `json:"execution,omitempty"`
	Coldstart bool   `json:"coldstart"`
}

func (*ExtendedFAAS) MarshalFastJSON

func (v *ExtendedFAAS) MarshalFastJSON(w *fastjson.Writer) error

type FAAS

type FAAS struct {
	// ID holds a unique identifier of the invoked serverless function.
	ID string `json:"id,omitempty"`
	// Execution holds the request ID of the function invocation.
	Execution string `json:"execution,omitempty"`
}

faas struct is a subset of go.elastic.co/apm/v2/model#FAAS

The purpose of having a separate struct is to have a custom marshalling logic that is targeted for the faas fields available for function logs. For example: `coldstart` value cannot be inferred for function logs so this struct drops the field entirely.

func (*FAAS) MarshalFastJSON

func (v *FAAS) MarshalFastJSON(w *fastjson.Writer) error

type LogContainer

type LogContainer struct {
	Log *LogLine `json:"log,omitempty"`
}

func (*LogContainer) MarshalFastJSON

func (v *LogContainer) MarshalFastJSON(w *fastjson.Writer) error

type LogLine

type LogLine struct {
	Message   string `json:"message"`
	Timestamp Time   `json:"@timestamp"`
	FAAS      *FAAS  `json:"faas,omitempty"`
}

func (*LogLine) MarshalFastJSON

func (v *LogLine) MarshalFastJSON(w *fastjson.Writer) error

type Metric

type Metric struct {
	Value float64 `json:"value"`
}

func (*Metric) MarshalFastJSON

func (v *Metric) MarshalFastJSON(w *fastjson.Writer) error

type Metrics

type Metrics struct {
	Timestamp Time              `json:"timestamp"`
	FAAS      *ExtendedFAAS     `json:"faas,omitempty"`
	Samples   map[string]Metric `json:"samples,omitempty"`
}

func (*Metrics) MarshalFastJSON

func (v *Metrics) MarshalFastJSON(w *fastjson.Writer) error

type MetricsContainer

type MetricsContainer struct {
	Metrics *Metrics `json:"metricset,omitempty"`
}

func (MetricsContainer) Add

func (mc MetricsContainer) Add(name string, value float64)

Add adds a metric with the given name, labels, and value, The labels are expected to be sorted lexicographically.

func (*MetricsContainer) MarshalFastJSON

func (v *MetricsContainer) MarshalFastJSON(w *fastjson.Writer) error

type Time

type Time time.Time

func (Time) MarshalFastJSON

func (t Time) MarshalFastJSON(w *fastjson.Writer) error

Jump to

Keyboard shortcuts

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