instrumentation

package
v0.0.0-...-6b55861 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 1 Imported by: 7

Documentation

Overview

package instrumentation defines primitives to support more observability throughout the constraint framework.

Index

Constants

View Source
const (

	// TemplateScope means the stat is associated with a template.
	TemplateScope = "template"
	// ConstraintScope means the state is associated with a constraint.
	ConstraintScope = "constraint"

	// description constants.
	UnknownDescription = "unknown description"

	// source constants.
	EngineSourceType = "engine"
)

Variables

View Source
var RegoSource = Source{
	Type:  EngineSourceType,
	Value: schema.Name,
}

Functions

This section is empty.

Types

type Label

type Label struct {
	Name  string      `json:"name"`
	Value interface{} `json:"value"`
}

Label is a name/value tuple to add metadata about a StatsEntry.

type Source

type Source struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

Source is a special Stat level label of the form type/value that is meant to be used to identify where a Stat is coming from.

type Stat

type Stat struct {
	Name   string      `json:"name"`
	Value  interface{} `json:"value"`
	Source Source      `json:"source"`
}

Stat is a Name, Value, Description tuple that may contain metrics or aggregations of metrics.

type StatsEntry

type StatsEntry struct {
	// Scope is the level of granularity that the Stats
	// were created at.
	Scope string `json:"scope"`
	// StatsFor is the specific kind of Scope type that Stats
	// were created for.
	StatsFor string   `json:"statsFor"`
	Stats    []*Stat  `json:"stats"`
	Labels   []*Label `json:"labels,omitempty"`
}

StatsEntry comprises of a generalized Key for all associated Stats.

Jump to

Keyboard shortcuts

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