instrumentation

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_EXEC_CMD string = "/bin/sh"
	ERROR_CODE       int    = -1
)
View Source
const (
	GET_JAVA_PID_CMD             string = "ps -o pid,comm,args | grep java | awk '{print$1,$2,$3}'"
	ATTACHED_ANNOTATION          string = "appd-attached"
	APPD_ATTACH_PENDING          string = "appd-attach-pending"
	APPD_ATTACH_FAILED           string = "Failed. Image unavailable"
	APPD_ATTACH_DEPLOYMENT       string = "appd-attach-deploy"
	DEPLOY_ANNOTATION            string = "appd-deploy-updated"
	DEPLOY_BIQ_ANNOTATION        string = "appd-deploy-biq-updated"
	APPD_APPID                   string = "appd-appid"
	APPD_TIERID                  string = "appd-tierid"
	APPD_NODEID                  string = "appd-nodeid"
	APPD_AGENT_ID                string = "appd-agent-id"
	APPD_NODENAME                string = "appd-nodename"
	MAX_INSTRUMENTATION_ATTEMPTS int    = 1
	ANNOTATION_UPDATE_ERROR      string = "ANNOTATION-UPDATE-FAILURE"
	APPD_SECRET_NAME             string = "appd-secret"
	APPD_SECRET_KEY_NAME         string = "appd-key"
	APPD_ASSOCIATE_ERROR         string = "appd-associate-error"
)

Variables

This section is empty.

Functions

func AgentInitExists

func AgentInitExists(podSpec *v1.PodSpec, bag *m.AppDBag) bool

func AnalyticsAgentExists

func AnalyticsAgentExists(podSpec *v1.PodSpec, bag *m.AppDBag) bool

func GetAgentRequestsForDeployment

func GetAgentRequestsForDeployment(deploy *appsv1.Deployment, bag *m.AppDBag, l *log.Logger) *m.AgentRequestList

func GetAttachMetadata

func GetAttachMetadata(appTag string, tierTag string, deploy *appsv1.Deployment, bag *m.AppDBag) (string, string, string)

func GetVolumePath

func GetVolumePath(bag *m.AppDBag, r *m.AgentRequest) string

func IsPodInstrumented

func IsPodInstrumented(podObj *v1.Pod, l *log.Logger) bool

func ShouldInstrumentDeployment

func ShouldInstrumentDeployment(deployObj *appsv1.Deployment, bag *m.AppDBag, pendingCache *[]string, failedCache *map[string]m.AttachStatus, l *log.Logger) (bool, bool, *m.AgentRequestList)

Types

type AgentInjector

type AgentInjector struct {
	ClientSet      *kubernetes.Clientset
	K8sConfig      *rest.Config
	Bag            *m.AppDBag
	AppdController *app.ControllerClient
	Logger         *log.Logger
}

func NewAgentInjector

func NewAgentInjector(client *kubernetes.Clientset, config *rest.Config, bag *m.AppDBag, appdController *app.ControllerClient, l *log.Logger) AgentInjector

func (AgentInjector) Associate

func (ai AgentInjector) Associate(podObj *v1.Pod, exec *Executor, agentRequest *m.AgentRequest) error

func (AgentInjector) EnsureInstrumentation

func (ai AgentInjector) EnsureInstrumentation(statusChanel chan m.AttachStatus, podObj *v1.Pod, podSchema *m.PodSchema) error

func (AgentInjector) RetryAssociate

func (ai AgentInjector) RetryAssociate(podObj *v1.Pod, agentRequest *m.AgentRequest) error

type DotNetInjector

type DotNetInjector struct {
	Bag            *m.AppDBag
	AppdController *app.ControllerClient
}

func NewDotNetInjector

func NewDotNetInjector(bag *m.AppDBag, appdController *app.ControllerClient) DotNetInjector

func (*DotNetInjector) AddEnvVars

func (dni *DotNetInjector) AddEnvVars(container *v1.Container, agentRequest *m.AgentRequest)

type Executor

type Executor struct {
	ClientSet *kubernetes.Clientset
	K8sConfig *rest.Config
	Logger    *log.Logger
}

func NewExecutor

func NewExecutor(clientSet *kubernetes.Clientset, config *rest.Config, l *log.Logger) Executor

func (*Executor) CopyFilesToPod

func (exec *Executor) CopyFilesToPod(podObject *v1.Pod, containerName string, src string, dest string) (int, string, error)

func (*Executor) RunCommand

func (exec *Executor) RunCommand(podObject *v1.Pod, cmd string, args string) (int, string, error)

func (*Executor) RunCommandInPod

func (exec *Executor) RunCommandInPod(podName string, namespace string, containerName string, cmd string, args string) (int, string, error)

type Writer

type Writer struct {
	Str []string
}

func (*Writer) GetOutput

func (w *Writer) GetOutput() string

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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