Documentation ¶
Index ¶
- Constants
- func AllTenants(_ string) (bool, error)
- func ListUsers(ctx context.Context, bucketClient objstore.Bucket) (users []string, err error)
- func TenantDeletionMarkExists(ctx context.Context, bkt objstore.BucketReader, userID string) (bool, error)
- func WriteTenantDeletionMark(ctx context.Context, bkt objstore.Bucket, userID string, ...) error
- type TenantDeletionMark
- type TenantsScanner
Constants ¶
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.
const TenantDeletionMarkPath = "markers/tenant-deletion-mark.json"
Relative to user-specific prefix.
Variables ¶
This section is empty.
Functions ¶
func AllTenants ¶ added in v1.1.0
AllTenants returns true to each call and should be used whenever the UsersScanner should not filter out any user due to sharding.
func TenantDeletionMarkExists ¶ added in v1.1.0
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 ¶ added in v1.1.0
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 ¶ added in v1.1.0
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 ¶ added in v1.1.0
func NewTenantDeletionMark(deletionTime time.Time) *TenantDeletionMark
func ReadTenantDeletionMark ¶ added in v1.1.0
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 ¶ added in v1.1.0
type TenantsScanner struct {
// contains filtered or unexported fields
}
func NewTenantsScanner ¶ added in v1.1.0
func (*TenantsScanner) ScanTenants ¶ added in v1.1.0
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.