services

package
v0.0.0-...-32c9aed Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OdigosSystemNamespace = "odigos-system"
)

Variables

This section is empty.

Functions

func AddDestinationOwnerReferenceToSecret

func AddDestinationOwnerReferenceToSecret(ctx context.Context, odigosns string, dest *v1alpha1.Destination) error

func ConvertFieldsToString

func ConvertFieldsToString(fields map[string]string) string

func ConvertSignals

func ConvertSignals(signals []model.SignalType) ([]common.ObservabilitySignal, error)

func CountAppsPerNamespace

func CountAppsPerNamespace(ctx context.Context) (map[string]int, error)

returns a map, where the key is a namespace name and the value is the number of apps in this namespace (not necessarily instrumented)

func CreateDestinationSecret

func CreateDestinationSecret(ctx context.Context, destType common.DestinationType, secretFields map[string]string, odigosns string) (*k8s.LocalObjectReference, error)

func DeleteInstrumentationRule

func DeleteInstrumentationRule(ctx context.Context, id string) (bool, error)

func DerefString

func DerefString(s *string) string

func DestinationTypeConfigToCategoryItem

func DestinationTypeConfigToCategoryItem(destConfig destinations.Destination) model.DestinationTypesCategoryItem

func ExportedSignalsObjectToSlice

func ExportedSignalsObjectToSlice(signals *model.ExportedSignalsInput) []common.ObservabilitySignal

func GetDestinationSecretFields

func GetDestinationSecretFields(c context.Context, odigosns string, dest *v1alpha1.Destination) (map[string]string, error)

func GetDestinationTypeConfig

func GetDestinationTypeConfig(destType common.DestinationType) (*destinations.Destination, error)

func GetDestinationTypes

func GetDestinationTypes() model.GetDestinationTypesResponse

func GetImageURL

func GetImageURL(image string) string

func GetInstrumentationRule

func GetInstrumentationRule(ctx context.Context, id string) (*model.InstrumentationRule, error)

func GetJsonMergePatchForInstrumentationLabel

func GetJsonMergePatchForInstrumentationLabel(enabled *bool) []byte

func GetWorkload

func GetWorkload(c context.Context, ns string, kind string, name string) (metav1.Object, int)

func GetWorkloadsInNamespace

func GetWorkloadsInNamespace(ctx context.Context, nsName string, instrumentationLabeled *bool) ([]model.K8sActualSource, error)

func K8sDestinationToEndpointFormat

func K8sDestinationToEndpointFormat(k8sDest v1alpha1.Destination, secretFields map[string]string) model.Destination

func ListInstrumentationRules

func ListInstrumentationRules(ctx context.Context) ([]*model.InstrumentationRule, error)

ListInstrumentationRules fetches all instrumentation rules

func StringPtr

func StringPtr(s string) *string

func SyncWorkloadsInNamespace

func SyncWorkloadsInNamespace(ctx context.Context, nsName string, workloads []model.PersistNamespaceSourceInput) error

func TransformFieldsToDataAndSecrets

func TransformFieldsToDataAndSecrets(destTypeConfig *destinations.Destination, fields map[string]string) (map[string]string, map[string]string)

func UpdateReportedName

func UpdateReportedName(
	ctx context.Context,
	ns, kind, name, reportedName string,
) error

func VerifyDestinationDataScheme

func VerifyDestinationDataScheme(destType common.DestinationType, destTypeConfig *destinations.Destination, data map[string]string) []error

Types

type GetConfigResponse

type GetConfigResponse struct {
	Installation InstallationStatus `json:"installation"`
}

func GetConfig

func GetConfig(c context.Context) GetConfigResponse

type GetNamespaceItem

type GetNamespaceItem struct {
	Name      string `json:"name"`
	Selected  bool   `json:"selected"`
	TotalApps int    `json:"totalApps"`
}

type GetNamespacesResponse

type GetNamespacesResponse struct {
	Namespaces []GetNamespaceItem `json:"namespaces"`
}

func GetK8SNamespaces

func GetK8SNamespaces(ctx context.Context) GetNamespacesResponse

type InstallationStatus

type InstallationStatus string
const (
	NewInstallation InstallationStatus = "NEW"
	AppsSelected    InstallationStatus = "APPS_SELECTED"
	Finished        InstallationStatus = "FINISHED"
)

type InstrumentedApplicationDetails

type InstrumentedApplicationDetails struct {
	Languages  []SourceLanguage   `json:"languages,omitempty"`
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

type PatchSourceRequest

type PatchSourceRequest struct {
	ReportedName *string `json:"reported_name"`
}

type PersistNamespaceItem

type PersistNamespaceItem struct {
	Name           string                   `json:"name"`
	SelectedAll    bool                     `json:"selected_all"`
	FutureSelected *bool                    `json:"future_selected,omitempty"`
	Objects        []PersistNamespaceObject `json:"objects"`
}

type PersistNamespaceObject

type PersistNamespaceObject struct {
	Name     string       `json:"name"`
	Kind     WorkloadKind `json:"kind"`
	Selected *bool        `json:"selected,omitempty"`
}

type Source

type Source struct {
	ThinSource
	ReportedName string `json:"reported_name,omitempty"`
}

func GetActualSource

func GetActualSource(ctx context.Context, ns string, kind string, name string) (*Source, error)

type SourceID

type SourceID struct {
	// combination of namespace, kind and name is unique
	Name      string `json:"name"`
	Kind      string `json:"kind"`
	Namespace string `json:"namespace"`
}

type SourceLanguage

type SourceLanguage struct {
	ContainerName string `json:"container_name"`
	Language      string `json:"language"`
}

type ThinSource

type ThinSource struct {
	SourceID
	NumberOfRunningInstances int                             `json:"number_of_running_instances"`
	IaDetails                *InstrumentedApplicationDetails `json:"instrumented_application_details"`
}

this object contains only part of the source fields. It is used to display the sources in the frontend

type WorkloadKind

type WorkloadKind string
const (
	WorkloadKindDeployment  WorkloadKind = "Deployment"
	WorkloadKindStatefulSet WorkloadKind = "StatefulSet"
	WorkloadKindDaemonSet   WorkloadKind = "DaemonSet"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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