bucket

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const PyroscopeInternalsPrefix = "__pyroscope_cluster"

PyroscopeInternalsPrefix is the bucket prefix under which all Pyroscope internal cluster-wide objects are stored. The object storage path delimiter (/) is appended to this prefix when building the full object path.

View Source
const TenantDeletionMarkPath = "markers/tenant-deletion-mark.json"

Relative to user-specific prefix.

Variables

This section is empty.

Functions

func AllTenants

func AllTenants(_ string) (bool, error)

AllTenants returns true to each call and should be used whenever the UsersScanner should not filter out any user due to sharding.

func ListUsers

func ListUsers(ctx context.Context, bucketClient objstore.Bucket) (users []string, err error)

ListUsers returns all user IDs found scanning the root of the bucket.

func TenantDeletionMarkExists

func TenantDeletionMarkExists(ctx context.Context, bkt objstore.BucketReader, userID string) (bool, error)

Checks for deletion mark for tenant. Errors other than "object not found" are returned.

func WriteTenantDeletionMark

func WriteTenantDeletionMark(ctx context.Context, bkt objstore.Bucket, userID string, cfgProvider objstore.TenantConfigProvider, mark *TenantDeletionMark) error

Uploads deletion mark to the tenant location in the bucket.

Types

type TenantDeletionMark

type TenantDeletionMark struct {
	// Unix timestamp when deletion marker was created.
	DeletionTime int64 `json:"deletion_time"`

	// Unix timestamp when cleanup was finished.
	FinishedTime int64 `json:"finished_time,omitempty"`
}

func NewTenantDeletionMark

func NewTenantDeletionMark(deletionTime time.Time) *TenantDeletionMark

func ReadTenantDeletionMark

func ReadTenantDeletionMark(ctx context.Context, bkt objstore.BucketReader, userID string) (*TenantDeletionMark, error)

Returns tenant deletion mark for given user, if it exists. If it doesn't exist, returns nil mark, and no error.

type TenantsScanner

type TenantsScanner struct {
	// contains filtered or unexported fields
}

func NewTenantsScanner

func NewTenantsScanner(bucketClient objstore.Bucket, isOwned func(userID string) (bool, error), logger log.Logger) *TenantsScanner

func (*TenantsScanner) ScanTenants

func (s *TenantsScanner) ScanTenants(ctx context.Context) (users, markedForDeletion []string, err error)

ScanTenants returns a fresh list of users found in the storage, that are not marked for deletion, and list of users marked for deletion.

If sharding is enabled, returned lists contains only the users owned by this instance.

Jump to

Keyboard shortcuts

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