Documentation ¶
Overview ¶
Package metrics is part of the Tarmac suite of Host Callback packages. This package provides users with the ability to provide WASM functions with a host callback interface that provides metrics tracking capabilities.
import ( "github.com/madflojo/tarmac/pkg/callbacks" "github.com/madflojo/tarmac/pkg/callbacks/metrics" ) func main() { // Create instance of metrics to register for callback execution metrics := metrics.New(metrics.Config{}) // Create Callback router and register metrics router := callbacks.New() router.RegisterCallback("metrics", "Counter", metrics.Counter) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidMetricName = fmt.Errorf("invalid metric name")
ErrInvalidMetricName is an error returned when the user supplies an invalid formatted metric name.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct{}
Config is provided to users to configure the Host Callback. All Tarmac Callbacks follow the same configuration format; each Config struct gives the specific Host Callback unique functionality.
type Metrics ¶
Metrics stores and manages the user-defined metrics created via WASM function callbacks.
func (*Metrics) Counter ¶
Counter will create and increment a counter metric. The expected input for this function is a MetricsCounter JSON.