model

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: Apache-2.0 Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 marshaling 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