Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Count ¶ added in v1.0.0
Count records a new metric instance with a value of 1. Example (to increment the new_users counter -- i.e to record a new instance of new_user):
metric.Count(ctx, "new_users", nil, 1)
func Duration ¶ added in v1.0.0
func Duration(ctx context.Context, name string, value time.Duration, tags []attribute.KeyValue, rate float64)
Duration records duration information for an event (in seconds).
Example:
duration := time.Millisecond * 30
tags = []attribute.KeyValue{ { Key: attribute.Key("table"), Value: attribute.StringValue("users"), }, } metric.Duration(ctx, "queries.select", duration, tags, 1)
func Histogram ¶
func Histogram(ctx context.Context, name string, value float64, tags []attribute.KeyValue, rate float64)
Histogram tracks the statistical distribution of a set of values for an event.
Example:
metric.Histogram(ctx, "logins.successful", 1.0, []{Key: "email", Value: "x@example.com"}, 1)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.