Documentation ¶
Overview ¶
Package metrics implements the outreach metrics API
This consists of the Count and Latency functions
Index ¶
- func ReportGRPCLatency(appName, callName string, latencySeconds float64, err error, ...)
- func ReportHTTPLatency(appName, callName string, latencySeconds float64, err error, ...)
- func ReportOutboundLatency(appName, callName string, latencySeconds float64, err error, ...)
- type CallKind
- type ReportLatencyOption
- type ReportLatencyOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReportGRPCLatency ¶ added in v1.5.0
func ReportGRPCLatency(appName, callName string, latencySeconds float64, err error, options ...ReportLatencyOption)
ReportGRPCLatency reports the grpc_request_handled metric for a request.
func ReportHTTPLatency ¶ added in v1.5.0
func ReportHTTPLatency(appName, callName string, latencySeconds float64, err error, options ...ReportLatencyOption)
ReportHTTPLatency reports the http_request_handled metric for a request.
func ReportOutboundLatency ¶ added in v1.5.0
func ReportOutboundLatency(appName, callName string, latencySeconds float64, err error, options ...ReportLatencyOption)
ReportOutboundLatency reports the outbound_call_seconds metric for a request.
Types ¶
type CallKind ¶
type CallKind string
CallKind is the type of call that was made. This is meant to differentiate between calls that are made to internal services vs calls that are made to 3rd party (external) services.
const ( // CallKindInternal is a call that was made to an internal service. // "internal" represents a service that is within the same organization. CallKindInternal CallKind = "internal" // CallKindExternal is a call that was made to an external service. // "external" represents a service that is outside of the organization, such // as a 3rd party service. CallKindExternal CallKind = "external" )
type ReportLatencyOption ¶
type ReportLatencyOption func(*ReportLatencyOptions)
func WithCallKind ¶
func WithCallKind(ck CallKind) ReportLatencyOption
WithCallKind sets the kind of call this was.
func WithExternalCall ¶
func WithExternalCall() ReportLatencyOption
WithExternalCall reports that this call was an external call
type ReportLatencyOptions ¶
type ReportLatencyOptions struct { // Kind is the type of call that was made Kind CallKind }
Click to show internal directories.
Click to hide internal directories.