Documentation
¶
Index ¶
- Constants
- Variables
- func InitPrometheus() (*metric.MeterProvider, error)
- type CounterFunc
- type GaugeFunc
- type MetricsHandler
- func (m MetricsHandler) AddAttributes(attributes ...attribute.KeyValue)
- func (m MetricsHandler) Counter(name string) client.MetricsCounter
- func (m MetricsHandler) Gauge(name string) client.MetricsGauge
- func (m MetricsHandler) GetAttributes() attribute.Set
- func (m MetricsHandler) GetMeter() metric.Meter
- func (m MetricsHandler) Timer(name string) client.MetricsTimer
- func (m MetricsHandler) WithTags(tags map[string]string) client.MetricsHandler
- type MetricsHandlerOptions
- type MetricsProvider
- type TimerFunc
Constants ¶
const ( DefaultPrometheusPath = "/metrics" TemporalProxyPrefix = "temporal_cloud_proxy_" // Encryption metrics EncryptLatency = TemporalProxyPrefix + "encrypt_latency" EncryptRequests = TemporalProxyPrefix + "encrypt_requests" EncryptErrors = TemporalProxyPrefix + "encrypt_errors" EncryptSuccess = TemporalProxyPrefix + "encrypt_success" // Decryption metrics DecryptLatency = TemporalProxyPrefix + "decrypt_latency" DecryptRequests = TemporalProxyPrefix + "decrypt_requests" DecryptErrors = TemporalProxyPrefix + "decrypt_errors" DecryptSuccess = TemporalProxyPrefix + "decrypt_success" // Materials manager get metrics MaterialsManagerGetLatency = TemporalProxyPrefix + "materials_manager_get_latency" MaterialsManagerGetRequests = TemporalProxyPrefix + "materials_manager_get_requests" MaterialsManagerGetErrors = TemporalProxyPrefix + "materials_manager_get_errors" MaterialsManagerGetSuccess = TemporalProxyPrefix + "materials_manager_get_success" // Materials manager decrypt metrics MaterialsManagerDecryptLatency = TemporalProxyPrefix + "materials_manager_decrypt_latency" MaterialsManagerDecryptRequests = TemporalProxyPrefix + "materials_manager_decrypt_requests" MaterialsManagerDecryptErrors = TemporalProxyPrefix + "materials_manager_decrypt_errors" MaterialsManagerDecryptSuccess = TemporalProxyPrefix + "materials_manager_decrypt_success" // Proxy metrics ProxyRequestTotal = TemporalProxyPrefix + "requests_total" ProxyRequestSuccess = TemporalProxyPrefix + "request_success" ProxyRequestErrors = TemporalProxyPrefix + "request_errors" ProxyLatency = TemporalProxyPrefix + "latency" )
const TemporalCloudMeterName = "temporal-cloud-proxy"
Variables ¶
var Module = fx.Provide(
newMetricsProvider,
)
Functions ¶
func InitPrometheus ¶
func InitPrometheus() (*metric.MeterProvider, error)
Types ¶
type CounterFunc ¶
type CounterFunc func(int64)
CounterFunc implements Counter with a single function.
type MetricsHandler ¶
type MetricsHandler struct {
// contains filtered or unexported fields
}
MetricsHandler is an implementation of client.MetricsHandler for open telemetry.
func ExtractMetricsHandler ¶
func ExtractMetricsHandler(handler client.MetricsHandler) *MetricsHandler
ExtractMetricsHandler gets the underlying Open Telemetry MetricsHandler from a MetricsHandler if any is present.
Raw use of the MetricHandler is discouraged but may be used for Histograms or other advanced features. This scope does not skip metrics during replay like the metrics handler does. Therefore the caller should check replay state.
func NewMetricsHandler ¶
func NewMetricsHandler(options MetricsHandlerOptions) MetricsHandler
NewMetricsHandler returns a client.MetricsHandler that is backed by the given Meter
func (MetricsHandler) AddAttributes ¶
func (m MetricsHandler) AddAttributes(attributes ...attribute.KeyValue)
func (MetricsHandler) Counter ¶
func (m MetricsHandler) Counter(name string) client.MetricsCounter
func (MetricsHandler) Gauge ¶
func (m MetricsHandler) Gauge(name string) client.MetricsGauge
func (MetricsHandler) GetAttributes ¶
func (m MetricsHandler) GetAttributes() attribute.Set
GetAttributes returns the attributes set on this handler.
func (MetricsHandler) GetMeter ¶
func (m MetricsHandler) GetMeter() metric.Meter
GetMeter returns the meter used by this handler.
func (MetricsHandler) Timer ¶
func (m MetricsHandler) Timer(name string) client.MetricsTimer
func (MetricsHandler) WithTags ¶
func (m MetricsHandler) WithTags(tags map[string]string) client.MetricsHandler
type MetricsHandlerOptions ¶
type MetricsHandlerOptions struct {
// Meter is the Meter to use. If not set, one is obtained from the global
// meter provider using the name "temporal-sdk-go".
Meter metric.Meter
// InitialAttributes to set on the handler
//
// Optional: Defaults to the empty set.
InitialAttributes attribute.Set
// OnError Callback to invoke if the provided meter returns an error.
//
// Optional: Defaults to panicking on any error.
OnError func(error)
}
MetricsHandlerOptions are options provided to NewMetricsHandler.