Andrey Smirnov 1a4d8364de
feat: implement metrics for Image Factory
Fixes #14

This adds "standard" HTTP metrics for the frontend, and also three kinds
of custom metrics:

* schematic get/create
* system extension popularity score
* asset build metrics: cached/not cached, bytes, requests, in dimension
  of asset kind

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2023-10-31 22:09:02 +04:00

25 lines
693 B
Go

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Package storage implements a storage for schematic data.
package storage
import (
"context"
"github.com/prometheus/client_golang/prometheus"
)
// Storage is the schematic storage.
type Storage interface {
prometheus.Collector
Head(ctx context.Context, id string) error
Get(ctx context.Context, id string) ([]byte, error)
Put(ctx context.Context, id string, data []byte) error
}
// ErrNotFoundTag tags the errors when the schematic is not found.
type ErrNotFoundTag = struct{}