ignore

package
v0.0.0-...-b04d5d2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: BSD-3-Clause Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartMetrics

func StartMetrics(ctx context.Context, store Store, interval time.Duration) error

StartMetrics starts a new monitoring routine for the given ignore.Store that counts expired ignore rules and pushes that info into a metric.

Types

type Rule

type Rule struct {
	// ID is the id used to store this Rule in a Store. They should be unique.
	ID string
	// Name is the email of the user who created the rule.
	CreatedBy string
	// UpdatedBy is the email of the user who last updated the rule.
	UpdatedBy string
	// Expires indicates a time at which a human should re-consider the rule and see if
	// it still needs to be applied.
	Expires time.Time
	// Query is a url-encoded set of key-value pairs that can be used to match traces.
	// For example: "config=angle_d3d9_es2&cpu_or_gpu_value=RadeonHD7770"
	Query string
	// Note is a comment by a developer, typically a bug.
	Note string
}

Rule defines a single ignore rule, matching zero or more traces based on Query.

func NewRule

func NewRule(createdByUser string, expires time.Time, queryStr string, note string) Rule

NewRule creates a new ignore rule with the given data.

type Store

type Store interface {
	// Create adds a new rule to the ignore store. The ID will be set if this call is successful.
	Create(context.Context, Rule) error

	// List returns all ignore rules in the ignore store.
	List(context.Context) ([]Rule, error)

	// Update sets a Rule. The "Name" field should be ignored, but all other fields should be
	// applied to the existing data.
	Update(ctx context.Context, rule Rule) error

	// Delete removes a Rule from the store. If the rule didn't exist before, there will be no error.
	Delete(ctx context.Context, id string) error
}

Store is an interface for a database that saves ignore rules.

Directories

Path Synopsis
Package sqlignorestore contains a SQL implementation of ignore.Store.
Package sqlignorestore contains a SQL implementation of ignore.Store.

Jump to

Keyboard shortcuts

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