tenancy

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Overview

Package tenancy provides functionality for managing tenant information across the observability platform.

The package defines a TenantRepository interface for retrieving tenant IDs and provides a Kubernetes-based implementation that extracts tenants from GrafanaOrganization resources.

Tenants represent isolated units within the multi-tenant observability platform and are used for filtering and organizing observability data (metrics, logs, traces) across different organizational boundaries.

Example usage:

tenantRepo := tenancy.NewKubernetesRepository(k8sClient)
tenants, err := tenantRepo.List(ctx)
if err != nil {
    return fmt.Errorf("failed to list tenants: %w", err)
}
// tenants contains a sorted, deduplicated list of tenant IDs

Index

Constants

View Source
const (
	TenantSelectorLabel = "observability.giantswarm.io/tenant"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KubernetesTenantRepository added in v0.57.0

type KubernetesTenantRepository struct {
	client.Client
}

KubernetesTenantRepository implements TenantRepository using Kubernetes resources.

func (KubernetesTenantRepository) List added in v0.57.0

List retrieves a unique, sorted list of tenant IDs from all active GrafanaOrganization resources.

type TenantRepository added in v0.57.0

type TenantRepository interface {
	// List retrieves a unique, sorted list of tenant IDs from all active GrafanaOrganization resources.
	List(ctx context.Context) ([]string, error)
}

TenantRepository defines an interface for reading tenant information.

func NewTenantRepository added in v0.58.0

func NewTenantRepository(client client.Client) TenantRepository

NewTenantRepository creates a new KubernetesTenantRepository.

Jump to

Keyboard shortcuts

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