model

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Overview

Package model provides the Elastic APM model types.

https://www.elastic.co/guide/en/apm/server/current/intake-api.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	// Name is the name of the Elastic APM agent, e.g. "Go".
	Name string `json:"name"`

	// Version is the version of the Elastic APM agent, e.g. "1.0.0".
	Version string `json:"version"`
}

Agent holds information about the Elastic APM agent.

func (*Agent) MarshalFastJSON

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

type AggregateDuration added in v1.15.0

type AggregateDuration struct {
	// Count holds the number of times the dropped span happened.
	Count int `json:"count"`
	// Sum holds dimensions about the dropped span's duration.
	Sum DurationSum `json:"sum"`
}

AggregateDuration duration

func (*AggregateDuration) MarshalFastJSON added in v1.15.0

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

type Cloud added in v1.9.0

type Cloud struct {
	// Provider is the cloud provider name, e.g. aws, azure, gcp.
	Provider string `json:"provider"`

	// Region is the cloud region name, e.g. us-east-1.
	Region string `json:"region,omitempty"`

	// AvailabilityZone is the cloud availability zone name, e.g. us-east-1a.
	AvailabilityZone string `json:"availability_zone,omitempty"`

	// Instance holds information about the cloud instance (virtual machine).
	Instance *CloudInstance `json:"instance,omitempty"`

	// Machine also holds information about the cloud instance (virtual machine).
	Machine *CloudMachine `json:"machine,omitempty"`

	// Account holds information about the cloud account.
	Account *CloudAccount `json:"account,omitempty"`

	// Project holds information about the cloud project.
	Project *CloudProject `json:"project,omitempty"`
}

Cloud represents the cloud in which the service is running.

func (*Cloud) MarshalFastJSON added in v1.9.0

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

type CloudAccount added in v1.9.0

type CloudAccount struct {
	// ID holds the cloud account identifier.
	ID string `json:"id,omitempty"`

	// ID holds the cloud account name.
	Name string `json:"name,omitempty"`
}

CloudAccount holds information about a cloud account.

func (*CloudAccount) MarshalFastJSON added in v1.9.0

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

type CloudInstance added in v1.9.0

type CloudInstance struct {
	// ID holds the cloud instance identifier.
	ID string `json:"id,omitempty"`

	// ID holds the cloud instance name.
	Name string `json:"name,omitempty"`
}

CloudInstance holds information about a cloud instance (virtual machine).

func (*CloudInstance) MarshalFastJSON added in v1.9.0

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

type CloudMachine added in v1.9.0

type CloudMachine struct {
	// Type holds the cloud instance type, e.g. t2.medium.
	Type string `json:"type,omitempty"`
}

CloudMachine holds information about a cloud instance (virtual machine).

func (*CloudMachine) MarshalFastJSON added in v1.9.0

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

type CloudProject added in v1.9.0

type CloudProject struct {
	// ID holds the cloud project identifier.
	ID string `json:"id,omitempty"`

	// Name holds the cloud project name.
	Name string `json:"name,omitempty"`
}

CloudProject holds information about a cloud project.

func (*CloudProject) MarshalFastJSON added in v1.9.0

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

type CompositeSpan added in v1.15.0

type CompositeSpan struct {
	// Count is the number of compressed spans the composite span represents.
	// The minimum count is 2, as a composite span represents at least two spans.
	Count int `json:"count"`
	// Sum is the durations of all compressed spans this composite span
	// represents in milliseconds.
	Sum float64 `json:"sum"`
	// A string value indicating which compression strategy was used. The valid
	// values are `exact_match` and `same_kind`.
	CompressionStrategy string `json:"compression_strategy"`
}

CompositeSpan holds details on a group of spans represented by a single one.

func (*CompositeSpan) MarshalFastJSON added in v1.15.0

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

type Container added in v1.1.0

type Container struct {
	// ID is the unique container ID.
	ID string `json:"id"`
}

Container represents the container (e.g. Docker) running the service.

func (*Container) MarshalFastJSON added in v1.1.0

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

type Context

type Context struct {
	// Custom holds custom context relating to the transaction or error.
	Custom IfaceMap `json:"custom,omitempty"`

	// Request holds details of the HTTP request relating to the
	// transaction or error, if relevant.
	Request *Request `json:"request,omitempty"`

	// Response holds details of the HTTP response relating to the
	// transaction or error, if relevant.
	Response *Response `json:"response,omitempty"`

	// User holds details of the authenticated user relating to the
	// transaction or error, if relevant.
	User *User `json:"user,omitempty"`

	// Tags holds user-defined key/value pairs.
	Tags IfaceMap `json:"tags,omitempty"`

	// Service holds values to overrides service-level metadata.
	Service *Service `json:"service,omitempty"`
}

Context holds contextual information relating to a transaction or error.

func (*Context) MarshalFastJSON

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

type Cookies

type Cookies []*http.Cookie

Cookies holds a collection of HTTP cookies.

func (Cookies) MarshalFastJSON

func (c Cookies) MarshalFastJSON(w *fastjson.Writer) error

MarshalFastJSON writes the JSON representation of c to w.

func (*Cookies) UnmarshalJSON

func (c *Cookies) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the JSON data into c.

type DatabaseSpanContext

type DatabaseSpanContext struct {
	// Instance holds the database instance name.
	Instance string `json:"instance,omitempty"`

	// Statement holds the database statement (e.g. query).
	Statement string `json:"statement,omitempty"`

	// RowsAffected holds the number of rows affected by the
	// database operation.
	RowsAffected *int64 `json:"rows_affected,omitempty"`

	// Type holds the database type. For any SQL database,
	// this should be "sql"; for others, the lower-cased
	// database category, e.g. "cassandra", "hbase", "redis".
	Type string `json:"type,omitempty"`

	// User holds the username used for database access.
	User string `json:"user,omitempty"`
}

DatabaseSpanContext holds contextual information for database operation spans.

func (*DatabaseSpanContext) MarshalFastJSON

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

type DestinationCloudSpanContext added in v1.12.0

type DestinationCloudSpanContext struct {
	// Region holds the destination cloud region.
	Region string `json:"region,omitempty"`
}

DestinationCloudSpanContext holds contextual information about a destination cloud.

func (*DestinationCloudSpanContext) MarshalFastJSON added in v1.12.0

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

type DestinationServiceSpanContext added in v1.7.0

type DestinationServiceSpanContext struct {
	// Type holds the destination service type. Deprecated.
	Type string `json:"type,omitempty"`

	// Name holds the destination service name. Deprecated.
	Name string `json:"name"`

	// Resource identifies the destination service
	// resource, e.g. a URI or message queue name.
	Resource string `json:"resource,omitempty"`
}

DestinationServiceSpanContext holds contextual information about a destination service.

func (*DestinationServiceSpanContext) MarshalFastJSON added in v1.7.0

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

type DestinationSpanContext added in v1.7.0

type DestinationSpanContext struct {
	// Address holds the network address of the destination service.
	// This may be a hostname, FQDN, or (IPv4 or IPv6) network address.
	Address string `json:"address,omitempty"`

	// Port holds the network port for the destination service.
	Port int `json:"port,omitempty"`

	// Service holds additional destination service context.
	Service *DestinationServiceSpanContext `json:"service,omitempty"`

	// Cloud holds additional destination cloud context.
	Cloud *DestinationCloudSpanContext `json:"cloud,omitempty"`
}

DestinationSpanContext holds contextual information about the destination for a span that relates to an operation involving an external service.

func (*DestinationSpanContext) MarshalFastJSON added in v1.7.0

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

type DroppedSpansStats added in v1.15.0

type DroppedSpansStats struct {
	// DestinationServiceResource identifies the destination service resource
	// being operated on. e.g. 'http://elastic.co:80', 'elasticsearch', 'rabbitmq/queue_name'.
	DestinationServiceResource string `json:"destination_service_resource"`
	// Outcome of the span: success, failure, or unknown. Outcome may be one of
	// a limited set of permitted values describing the success or failure of
	// the span. It can be used for calculating error rates for outgoing requests.
	Outcome string `json:"outcome"`
	// Duration holds duration aggregations about the dropped span.
	Duration AggregateDuration `json:"duration"`
}

DroppedSpansStats holds information about spans that were dropped (for example due to transaction_max_spans or exit_span_min_duration).

func (*DroppedSpansStats) MarshalFastJSON added in v1.15.0

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

type DurationSum added in v1.15.0

type DurationSum struct {
	// Sum of the duration of a span in Microseconds.
	Us int64 `json:"us"`
}

DurationSum contains units for duration

func (*DurationSum) MarshalFastJSON added in v1.15.0

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

type Error

type Error struct {
	// Timestamp holds the time at which the error occurred.
	Timestamp Time `json:"timestamp"`

	// ID holds the 128-bit hex-encoded error ID.
	ID TraceID `json:"id"`

	// TraceID holds the ID of the trace within which the error occurred.
	TraceID TraceID `json:"trace_id,omitempty"`

	// ParentID holds the ID of the transaction within which the error
	// occurred.
	ParentID SpanID `json:"parent_id,omitempty"`

	// TransactionID holds the ID of the transaction within which the error occurred.
	TransactionID SpanID `json:"transaction_id,omitempty"`

	// Culprit holds the name of the function which
	// produced the error.
	Culprit string `json:"culprit,omitempty"`

	// Context holds contextual information relating to the error.
	Context *Context `json:"context,omitempty"`

	// Exception holds details of the exception (error or panic)
	// to which this error relates.
	Exception Exception `json:"exception,omitempty"`

	// Log holds additional information added when logging the error.
	Log Log `json:"log,omitempty"`

	// Transaction holds information about the transaction within which the error occurred.
	Transaction ErrorTransaction `json:"transaction,omitempty"`
}

Error represents an error occurring in the service.

func (*Error) MarshalFastJSON

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

type ErrorTransaction

type ErrorTransaction struct {
	// Sampled indicates that the transaction was sampled.
	Sampled *bool `json:"sampled,omitempty"`

	// Type holds the transaction type.
	Type string `json:"type,omitempty"`
}

ErrorTransaction holds information about the transaction within which an error occurred.

func (*ErrorTransaction) MarshalFastJSON

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

type Exception

type Exception struct {
	// Message holds the error message.
	Message string `json:"message"`

	// Code holds the error code. This may be a number or a string.
	Code ExceptionCode `json:"code,omitempty"`

	// Type holds the type of the exception.
	Type string `json:"type,omitempty"`

	// Module holds the exception type's module namespace.
	Module string `json:"module,omitempty"`

	// Attributes holds arbitrary exception-type specific attributes.
	Attributes map[string]interface{} `json:"attributes,omitempty"`

	// Stacktrace holds stack frames corresponding to the exception.
	Stacktrace []StacktraceFrame `json:"stacktrace,omitempty"`

	// Handled indicates whether or not the error was caught and handled.
	Handled bool `json:"handled"`

	// Cause holds the causes of this error.
	Cause []Exception `json:"cause,omitempty"`
}

Exception represents an exception: an error or panic.

func (*Exception) MarshalFastJSON

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

type ExceptionCode

type ExceptionCode struct {
	String string
	Number float64
}

ExceptionCode represents an exception code as either a number or a string.

func (*ExceptionCode) MarshalFastJSON

func (c *ExceptionCode) MarshalFastJSON(w *fastjson.Writer) error

MarshalFastJSON writes the JSON representation of c to w.

func (*ExceptionCode) UnmarshalJSON

func (c *ExceptionCode) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the JSON data into c.

type Framework

type Framework struct {
	// Name is the name of the framework.
	Name string `json:"name"`

	// Version is the version of the framework.
	Version string `json:"version"`
}

Framework holds information about the framework (typically web) used by the service.

func (*Framework) MarshalFastJSON

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

type HTTPSpanContext added in v1.0.0

type HTTPSpanContext struct {
	// URL is the request URL.
	URL *url.URL

	// StatusCode holds the HTTP response status code.
	StatusCode int `json:"status_code,omitempty"`
}

HTTPSpanContext holds contextual information for HTTP client request spans.

func (*HTTPSpanContext) MarshalFastJSON added in v1.0.0

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

MarshalFastJSON writes the JSON representation of v to w.

func (*HTTPSpanContext) UnmarshalJSON added in v1.0.0

func (v *HTTPSpanContext) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the JSON data into v.

type Header struct {
	Key    string
	Values []string
}

Header holds an HTTP header, with one or more values.

func (*Header) MarshalFastJSON added in v1.0.0

func (*Header) MarshalFastJSON(w *fastjson.Writer) error

MarshalFastJSON writes the JSON representation of h to w.

type Headers added in v1.0.0

type Headers []Header

Headers holds a collection of HTTP headers.

func (Headers) MarshalFastJSON added in v1.0.0

func (hs Headers) MarshalFastJSON(w *fastjson.Writer) error

MarshalFastJSON writes the JSON representation of h to w.

func (*Headers) UnmarshalJSON added in v1.0.0

func (hs *Headers) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the JSON data into c.

type IfaceMap

type IfaceMap []IfaceMapItem

IfaceMap is a slice-representation of map[string]interface{}, optimized for fast JSON encoding.

Slice items are expected to be ordered by key.

func (IfaceMap) MarshalFastJSON

func (m IfaceMap) MarshalFastJSON(w *fastjson.Writer) (firstErr error)

MarshalFastJSON writes the JSON representation of m to w.

func (*IfaceMap) UnmarshalJSON

func (m *IfaceMap) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the JSON data into m.

type IfaceMapItem

type IfaceMapItem struct {
	// Key is the map item's key.
	Key string

	// Value is the map item's value.
	Value interface{}
}

IfaceMapItem holds a string key and value.

func (*IfaceMapItem) MarshalFastJSON

func (*IfaceMapItem) MarshalFastJSON(*fastjson.Writer) error

MarshalFastJSON exists to prevent code generation for IfaceMapItem.

type Kubernetes added in v1.1.0

type Kubernetes struct {
	// Namespace names the Kubernetes namespace in which the pod exists.
	Namespace string `json:"namespace,omitempty"`

	// Node describes the Kubernetes node running the service's pod.
	Node *KubernetesNode `json:"node,omitempty"`

	// Pod describes the Kubernetes pod running the service.
	Pod *KubernetesPod `json:"pod,omitempty"`
}

Kubernetes describes properties of the Kubernetes node and pod in which the service is running.

func (*Kubernetes) MarshalFastJSON added in v1.1.0

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

type KubernetesNode added in v1.1.0

type KubernetesNode struct {
	// Name holds the node name.
	Name string `json:"name,omitempty"`
}

KubernetesNode describes a Kubernetes node.

func (*KubernetesNode) MarshalFastJSON added in v1.1.0

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

type KubernetesPod added in v1.1.0

type KubernetesPod struct {
	// Name holds the pod name.
	Name string `json:"name,omitempty"`

	// UID holds the pod UID.
	UID string `json:"uid,omitempty"`
}

KubernetesPod describes a Kubernetes pod.

func (*KubernetesPod) MarshalFastJSON added in v1.1.0

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

type Language

type Language struct {
	// Name is the name of the programming language.
	Name string `json:"name"`

	// Version is the version of the programming language.
	Version string `json:"version,omitempty"`
}

Language holds information about the programming language used.

func (*Language) MarshalFastJSON

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

type Log

type Log struct {
	// Message holds the logged error message.
	Message string `json:"message"`

	// Level holds the severity of the log record.
	Level string `json:"level,omitempty"`

	// LoggerName holds the name of the logger used.
	LoggerName string `json:"logger_name,omitempty"`

	// ParamMessage holds a parameterized message,  e.g.
	// "Could not connect to %s". The string is not interpreted,
	// but may be used for grouping errors.
	ParamMessage string `json:"param_message,omitempty"`

	// Stacktrace holds stack frames corresponding to the error.
	Stacktrace []StacktraceFrame `json:"stacktrace,omitempty"`
}

Log holds additional information added when logging an error.

func (*Log) MarshalFastJSON

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

type MessageQueueSpanContext added in v1.12.0

type MessageQueueSpanContext struct {
	// Name holds the message queue name.
	Name string `json:"name,omitempty"`
}

MessageQueueSpanContext holds contextual information about a message queue.

func (*MessageQueueSpanContext) MarshalFastJSON added in v1.12.0

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

type MessageSpanContext added in v1.12.0

type MessageSpanContext struct {
	// Queue holds the destination cloud region.
	Queue *MessageQueueSpanContext `json:"queue,omitempty"`
}

MessageSpanContext holds contextual information about a message.

func (*MessageSpanContext) MarshalFastJSON added in v1.12.0

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

type Metric added in v1.0.0

type Metric struct {
	Type string `json:"type,omitempty"`
	// Value holds the metric value.
	Value float64 `json:"value"`
	// Buckets holds the metric bucket values.
	Values []float64 `json:"values,omitempty"`
	// Count holds the metric observation count for the bucket.
	Counts []uint64 `json:"counts,omitempty"`
}

Metric holds metric values.

func (*Metric) MarshalFastJSON added in v1.0.0

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

MarshalFastJSON writes the JSON representation of v to w.

type Metrics added in v1.0.0

type Metrics struct {
	// Timestamp holds the time at which the metric samples were taken.
	Timestamp Time `json:"timestamp"`

	// Transaction optionally holds the name and type of transactions
	// with which these metrics are associated.
	Transaction MetricsTransaction `json:"transaction,omitempty"`

	// Span optionally holds the type and subtype of the spans with
	// which these metrics are associated.
	Span MetricsSpan `json:"span,omitempty"`

	// Labels holds a set of labels associated with the metrics.
	// The labels apply uniformly to all metric samples in the set.
	//
	// NOTE(axw) the schema calls the field "tags", but we use
	// "labels" for agent-internal consistency. Labels aligns better
	// with the common schema, anyway.
	Labels StringMap `json:"tags,omitempty"`

	// Samples holds a map of metric samples, keyed by metric name.
	Samples map[string]Metric `json:"samples"`
}

Metrics holds a set of metric samples, with an optional set of labels.

func (*Metrics) MarshalFastJSON added in v1.0.0

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

type MetricsSpan added in v1.5.0

type MetricsSpan struct {
	Type    string `json:"type,omitempty"`
	Subtype string `json:"subtype,omitempty"`
}

MetricsSpan holds span identifiers for metrics.

func (*MetricsSpan) MarshalFastJSON added in v1.5.0

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

type MetricsTransaction added in v1.5.0

type MetricsTransaction struct {
	Type string `json:"type,omitempty"`
	Name string `json:"name,omitempty"`
}

MetricsTransaction holds transaction identifiers for metrics.

func (*MetricsTransaction) MarshalFastJSON added in v1.5.0

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

type Process

type Process struct {
	// Pid is the process ID.
	Pid int `json:"pid"`

	// Ppid is the parent process ID, if known.
	Ppid *int `json:"ppid,omitempty"`

	// Title is the title of the process.
	Title string `json:"title,omitempty"`

	// Argv holds the command line arguments used to start the process.
	Argv []string `json:"argv,omitempty"`
}

Process represents an operating system process.

func (*Process) MarshalFastJSON

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

type Request

type Request struct {
	// URL is the request URL.
	URL URL `json:"url"`

	// Method holds the HTTP request method.
	Method string `json:"method"`

	// Headers holds the request headers.
	Headers Headers `json:"headers,omitempty"`

	// Body holds the request body, if body capture is enabled.
	Body *RequestBody `json:"body,omitempty"`

	// HTTPVersion holds the HTTP version of the request.
	HTTPVersion string `json:"http_version,omitempty"`

	// Cookies holds the parsed cookies.
	Cookies Cookies `json:"cookies,omitempty"`

	// Env holds environment information passed from the
	// web framework to the request handler.
	Env map[string]string `json:"env,omitempty"`

	// Socket holds transport-level information.
	Socket *RequestSocket `json:"socket,omitempty"`
}

Request represents an HTTP request.

func (*Request) MarshalFastJSON

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

type RequestBody

type RequestBody struct {
	// Raw holds the raw body content.
	Raw string

	// Form holds the form data from POST, PATCH, or PUT body parameters.
	Form url.Values
}

RequestBody holds a request body.

Exactly one of Raw or Form must be set.

func (*RequestBody) MarshalFastJSON

func (b *RequestBody) MarshalFastJSON(w *fastjson.Writer) error

MarshalFastJSON writes the JSON representation of b to w.

func (*RequestBody) UnmarshalJSON

func (b *RequestBody) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the JSON data into b.

type RequestSocket

type RequestSocket struct {
	// Encrypted indicates whether or not the request was sent
	// as an SSL/HTTPS request. Deprecated.
	Encrypted bool `json:"encrypted,omitempty"`

	// RemoteAddress holds the remote address for the request.
	RemoteAddress string `json:"remote_address,omitempty"`
}

RequestSocket holds transport-level information relating to an HTTP request.

func (*RequestSocket) MarshalFastJSON

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

type Response

type Response struct {
	// StatusCode holds the HTTP response status code.
	StatusCode int `json:"status_code,omitempty"`

	// Headers holds the response headers.
	Headers Headers `json:"headers,omitempty"`

	// HeadersSent indicates whether or not headers were sent
	// to the client.
	HeadersSent *bool `json:"headers_sent,omitempty"`

	// Finished indicates whether or not the response was finished.
	Finished *bool `json:"finished,omitempty"`
}

Response represents an HTTP response.

func (*Response) MarshalFastJSON

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

type Runtime

type Runtime struct {
	// Name is the name of the programming language runtime.
	Name string `json:"name"`

	// Version is the version of the programming language runtime.
	Version string `json:"version"`
}

Runtime holds information about the programming language runtime.

func (*Runtime) MarshalFastJSON

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

type Service

type Service struct {
	// Name is the immutable name of the service.
	Name string `json:"name,omitempty"`

	// Version is the version of the service, if it has one.
	Version string `json:"version,omitempty"`

	// Environment is the name of the service's environment, if it has
	// one, e.g. "production" or "staging".
	Environment string `json:"environment,omitempty"`

	// Agent holds information about the Elastic APM agent tracing this
	// service's transactions.
	Agent *Agent `json:"agent,omitempty"`

	// Framework holds information about the service's framework, if any.
	Framework *Framework `json:"framework,omitempty"`

	// Language holds information about the programming language in which
	// the service is written.
	Language *Language `json:"language,omitempty"`

	// Runtime holds information about the programming language runtime
	// running this service.
	Runtime *Runtime `json:"runtime,omitempty"`

	// Node holds unique information about each service node
	Node *ServiceNode `json:"node,omitempty"`
}

Service represents the service handling transactions being traced.

func (*Service) MarshalFastJSON

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

type ServiceNode added in v1.6.0

type ServiceNode struct {
	// ConfiguredName holds the name of the service node
	ConfiguredName string `json:"configured_name,omitempty"`
}

ServiceNode holds unique information about each service node

func (*ServiceNode) MarshalFastJSON added in v1.6.0

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

type Span

type Span struct {
	// Name holds the name of the span.
	Name string `json:"name"`

	// Timestamp holds the time at which the span started.
	Timestamp Time `json:"timestamp"`

	// Duration holds the duration of the span, in milliseconds.
	Duration float64 `json:"duration"`

	// Type identifies the overarching type of the span,
	// e.g. "db" or "external".
	Type string `json:"type"`

	// Subtype identifies the subtype of the span,
	// e.g. "mysql" or "http".
	Subtype string `json:"subtype,omitempty"`

	// Action identifies the action that is being undertaken, e.g. "query".
	Action string `json:"action,omitempty"`

	// ID holds the ID of the span.
	ID SpanID `json:"id"`

	// TransactionID holds the ID of the transaction of which the span is a part.
	TransactionID SpanID `json:"transaction_id,omitempty"`

	// TraceID holds the ID of the trace that this span is a part of.
	TraceID TraceID `json:"trace_id"`

	// ParentID holds the ID of the span's parent (span or transaction).
	ParentID SpanID `json:"parent_id,omitempty"`

	// SampleRate holds the sample rate in effect when the trace was started,
	// if known. This is used by the server to aggregate span metrics.
	SampleRate *float64 `json:"sample_rate,omitempty"`

	// Context holds contextual information relating to the span.
	Context *SpanContext `json:"context,omitempty"`

	// Stacktrace holds stack frames corresponding to the span.
	Stacktrace []StacktraceFrame `json:"stacktrace,omitempty"`

	// Outcome holds the span outcome: success, failure, or unknown.
	Outcome string `json:"outcome,omitempty"`

	// Composite is set when the span is a composite span and represents an
	// aggregated set of spans as defined by `composite.compression_strategy`.
	Composite *CompositeSpan `json:"composite,omitempty"`
}

Span represents a span within a transaction.

func (*Span) MarshalFastJSON

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

type SpanContext

type SpanContext struct {
	// Destination holds information about a destination service.
	Destination *DestinationSpanContext `json:"destination,omitempty"`

	// Database holds contextual information for database
	// operation spans.
	Database *DatabaseSpanContext `json:"db,omitempty"`

	// Message holds contextual information for message operation spans.
	Message *MessageSpanContext `json:"message,omitempty"`

	// HTTP holds contextual information for HTTP client request spans.
	HTTP *HTTPSpanContext `json:"http,omitempty"`

	// Tags holds user-defined key/value pairs.
	Tags IfaceMap `json:"tags,omitempty"`
}

SpanContext holds contextual information relating to the span.

func (*SpanContext) MarshalFastJSON

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

type SpanCount

type SpanCount struct {
	// Dropped holds the number of spans dropped within a transaction.
	// This does not include spans that were started and dropped due
	// to full buffers, network errors, etc.
	Dropped int `json:"dropped"`

	// Started holds the number of spans started within a transaction.
	Started int `json:"started"`
}

SpanCount holds statistics on spans within a transaction.

func (*SpanCount) MarshalFastJSON

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

type SpanID added in v1.0.0

type SpanID [8]byte

SpanID holds a 64-bit span ID. Despite its name, this is used for both spans and transactions.

func (*SpanID) MarshalFastJSON added in v1.0.0

func (id *SpanID) MarshalFastJSON(w *fastjson.Writer) error

MarshalFastJSON writes the JSON representation of id to w.

func (*SpanID) UnmarshalJSON added in v1.0.0

func (id *SpanID) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the JSON data into id.

type StacktraceFrame

type StacktraceFrame struct {
	// AbsolutePath holds the absolute path of the source file for the
	// stack frame.
	AbsolutePath string `json:"abs_path,omitempty"`

	// File holds the base filename of the source file for the stack frame.
	File string `json:"filename"`

	// Line holds the line number of the source for the stack frame.
	Line int `json:"lineno"`

	// Column holds the column number of the source for the stack frame.
	Column *int `json:"colno,omitempty"`

	// Module holds the module to which the frame belongs. For Go, we
	// use the package path (e.g. "net/http").
	Module string `json:"module,omitempty"`

	// Classname holds the name of the class to which the frame belongs.
	Classname string `json:"classname,omitempty"`

	// Function holds the name of the function to which the frame belongs.
	Function string `json:"function,omitempty"`

	// LibraryFrame indicates whether or not the frame corresponds to
	// library or user code.
	LibraryFrame bool `json:"library_frame,omitempty"`

	// ContextLine holds the line of source code to which the frame
	// corresponds.
	ContextLine string `json:"context_line,omitempty"`

	// PreContext holds zero or more lines of source code preceding the
	// line corresponding to the frame.
	PreContext []string `json:"pre_context,omitempty"`

	// PostContext holds zero or more lines of source code proceeding the
	// line corresponding to the frame.
	PostContext []string `json:"post_context,omitempty"`

	// Vars holds local variables for this stack frame.
	Vars map[string]interface{} `json:"vars,omitempty"`
}

StacktraceFrame describes a stack frame.

func (*StacktraceFrame) MarshalFastJSON

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

type StringMap added in v1.0.0

type StringMap []StringMapItem

StringMap is a slice-representation of map[string]string, optimized for fast JSON encoding.

Slice items are expected to be ordered by key.

func (StringMap) MarshalFastJSON added in v1.0.0

func (m StringMap) MarshalFastJSON(w *fastjson.Writer) (firstErr error)

MarshalFastJSON writes the JSON representation of m to w.

func (*StringMap) UnmarshalJSON added in v1.0.0

func (m *StringMap) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the JSON data into m.

type StringMapItem added in v1.0.0

type StringMapItem struct {
	// Key is the map item's key.
	Key string

	// Value is the map item's value.
	Value string
}

StringMapItem holds a string key and value.

func (*StringMapItem) MarshalFastJSON added in v1.0.0

func (*StringMapItem) MarshalFastJSON(*fastjson.Writer) error

MarshalFastJSON exists to prevent code generation for StringMapItem.

type System

type System struct {
	// Architecture is the system's hardware architecture.
	Architecture string `json:"architecture,omitempty"`

	// Hostname is the system's hostname.
	Hostname string `json:"hostname,omitempty"`

	// Platform is the system's platform, or operating system name.
	Platform string `json:"platform,omitempty"`

	// Container describes the container running the service.
	Container *Container `json:"container,omitempty"`

	// Kubernetes describes the kubernetes node and pod running the service.
	Kubernetes *Kubernetes `json:"kubernetes,omitempty"`
}

System represents the system (operating system and machine) running the service.

func (*System) MarshalFastJSON

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

type Time

type Time time.Time

Time is a timestamp, formatted as a number of microseconds since January 1, 1970 UTC.

func (Time) MarshalFastJSON

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

MarshalFastJSON writes the JSON representation of t to w.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the JSON data into t.

type TraceID added in v1.0.0

type TraceID [16]byte

TraceID holds a 128-bit trace ID.

func (*TraceID) MarshalFastJSON added in v1.0.0

func (id *TraceID) MarshalFastJSON(w *fastjson.Writer) error

MarshalFastJSON writes the JSON representation of id to w.

func (*TraceID) UnmarshalJSON added in v1.0.0

func (id *TraceID) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the JSON data into id.

type Transaction

type Transaction struct {
	// ID holds the 64-bit hex-encoded transaction ID.
	ID SpanID `json:"id"`

	// TraceID holds the ID of the trace that this transaction is a part of.
	TraceID TraceID `json:"trace_id"`

	// ParentID holds the ID of the transaction's parent span or transaction.
	ParentID SpanID `json:"parent_id,omitempty"`

	// Name holds the name of the transaction.
	Name string `json:"name"`

	// Type identifies the service-domain specific type of the request,
	// e.g. "request" or "backgroundjob".
	Type string `json:"type"`

	// Timestamp holds the time at which the transaction started.
	Timestamp Time `json:"timestamp"`

	// Duration records how long the transaction took to complete,
	// in milliseconds.
	Duration float64 `json:"duration"`

	// Result holds the result of the transaction, e.g. the status code
	// for HTTP requests.
	Result string `json:"result,omitempty"`

	// Context holds contextual information relating to the transaction.
	Context *Context `json:"context,omitempty"`

	// Sampled indicates that the transaction was sampled, and
	// includes all available information. Non-sampled transactions
	// omit Context.
	//
	// If Sampled is unspecified (nil), it is equivalent to setting
	// it to true.
	Sampled *bool `json:"sampled,omitempty"`

	// SampleRate holds the sample rate in effect when the trace was started,
	// if known. This is used by the server to aggregate transaction metrics.
	SampleRate *float64 `json:"sample_rate,omitempty"`

	// SpanCount holds statistics on spans within a transaction.
	SpanCount SpanCount `json:"span_count"`

	// DroppedSpansStats holds information about spans that were dropped
	// (for example due to transaction_max_spans or exit_span_min_duration).
	DroppedSpansStats []DroppedSpansStats `json:"dropped_spans_stats,omitempty"`

	// Outcome holds the transaction outcome: success, failure, or unknown.
	Outcome string `json:"outcome,omitempty"`
}

Transaction represents a transaction handled by the service.

func (*Transaction) MarshalFastJSON

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

type URL

type URL struct {
	// Full is the full URL, e.g.
	// "https://example.com:443/search/?q=elasticsearch#top".
	Full string `json:"full,omitempty"`

	// Protocol is the scheme of the URL, e.g. "https".
	Protocol string `json:"protocol,omitempty"`

	// Hostname is the hostname for the URL, e.g. "example.com".
	Hostname string `json:"hostname,omitempty"`

	// Port is the port number in the URL, e.g. "443".
	Port string `json:"port,omitempty"`

	// Path is the path of the URL, e.g. "/search".
	Path string `json:"pathname,omitempty"`

	// Search is the query string of the URL, e.g. "q=elasticsearch".
	Search string `json:"search,omitempty"`

	// Hash is the fragment for references, e.g. "top" in the
	// URL example provided for Full.
	Hash string `json:"hash,omitempty"`
}

URL represents a server-side (transaction) request URL, broken down into its constituent parts.

func (*URL) MarshalFastJSON

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

MarshalFastJSON writes the JSON representation of v to w.

type User

type User struct {
	// Username holds the username of the user.
	Username string `json:"username,omitempty"`

	// ID identifies the user, e.g. a primary key. This may be
	// a string or number.
	ID string `json:"id,omitempty"`

	// Email holds the email address of the user.
	Email string `json:"email,omitempty"`
}

User holds information about an authenticated user.

func (*User) MarshalFastJSON

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

Jump to

Keyboard shortcuts

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