{"modulePath":"github.com/openshift/origin","version":"v1.6.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package monitorapi\n\n## Constants\n\n```go\nconst (\n\t// PodIPReused means the same pod IP is in use by two pods at the same time.\n\tPodIPReused = \"ReusedPodIP\"\n\n\tContainerErrImagePull                = \"ErrImagePull\"\n\tContainerUnrecognizedSignatureFormat = \"UnrecognizedSignatureFormat\"\n)\n```\n\n```go\nconst (\n\t// ObservedUpdateCountAnnotation is an annotation added locally (in the monitor only), that tracks how many updates\n\t// we've seen to this resource.  This is useful during post-processing for determining if we have a hot resource.\n\tObservedUpdateCountAnnotation = \"monitor.openshift.io/observed-update-count\"\n\n\t// ObservedRecreationCountAnnotation is an annotation added locally (in the monitor only), that tracks how many\n\t// time a resource has been recreated.  The internal cache doesn't remove an entry on delete.\n\t// This is useful during post-processing for determining if we have a hot resource.\n\tObservedRecreationCountAnnotation = \"monitor.openshift.io/observed-recreation-count\"\n)\n```\n\n```go\nconst (\n\tConstructionOwnerNodeLifecycle    = \"node-lifecycle-constructor\"\n\tConstructionOwnerPodLifecycle     = \"pod-lifecycle-constructor\"\n\tConstructionOwnerEtcdLifecycle    = \"etcd-lifecycle-constructor\"\n\tConstructionOwnerMachineLifecycle = \"machine-lifecycle-constructor\"\n\tConstructionOwnerLeaseChecker     = \"lease-checker\"\n\tConstructionOwnerOnPremHaproxy    = \"on-prem-haproxy-constructor\"\n\tConstructionOwnerOnPremKeepalived = \"on-prem-keepalived-constructor\"\n)\n```\n\n```go\nconst (\n\tSourceAlert                     IntervalSource = \"Alert\"\n\tSourceAPIServerShutdown         IntervalSource = \"APIServerShutdown\"\n\tSourceDisruption                IntervalSource = \"Disruption\"\n\tSourceE2ETest                   IntervalSource = \"E2ETest\"\n\tSourceKubeEvent                 IntervalSource = \"KubeEvent\"\n\tSourceNetworkManagerLog         IntervalSource = \"NetworkMangerLog\"\n\tSourceNodeMonitor               IntervalSource = \"NodeMonitor\"\n\tSourceHaproxyMonitor            IntervalSource = \"OnPremHaproxyMonitor\"\n\tSourceKeepalivedMonitor         IntervalSource = \"OnPremKeepalivedMonitor\"\n\tSourceUnexpectedReady           IntervalSource = \"NodeUnexpectedNotReady\"\n\tSourceUnreachable               IntervalSource = \"NodeUnreachable\"\n\tSourceKubeletLog                IntervalSource = \"KubeletLog\"\n\tSourceCrioLog                   IntervalSource = \"CrioLog\"\n\tSourceSystemdCoreDumpLog        IntervalSource = \"SystemdCoreDumpLog\"\n\tSourcePodLog                    IntervalSource = \"PodLog\"\n\tSourceEtcdLog                   IntervalSource = \"EtcdLog\"\n\tSourceEtcdLeadership            IntervalSource = \"EtcdLeadership\"\n\tSourcePodMonitor                IntervalSource = \"PodMonitor\"\n\tSourceMetricsEndpointDown       IntervalSource = \"MetricsEndpointDown\"\n\tAPIServerGracefulShutdown       IntervalSource = \"APIServerGracefulShutdown\"\n\tAPIServerClusterOperatorWatcher IntervalSource = \"APIServerClusterOperatorWatcher\"\n\tSourceAuditLog                  IntervalSource = \"AuditLog\"\n\n\tSourceTestData                IntervalSource = \"TestData\" // some tests have no real source to assign\n\tSourceOVSVswitchdLog          IntervalSource = \"OVSVswitchdLog\"\n\tSourcePathologicalEventMarker IntervalSource = \"PathologicalEventMarker\" // not sure if this is really helpful since the events all have a different origin\n\tSourceClusterOperatorMonitor  IntervalSource = \"ClusterOperatorMonitor\"\n\tSourceOperatorState           IntervalSource = \"OperatorState\"\n\tSourceVersionState            IntervalSource = \"VersionState\"\n\tSourceNodeState                              = \"NodeState\"\n\tSourcePodState                               = \"PodState\"\n\tSourceCloudMetrics                           = \"CloudMetrics\"\n\n\tSourceAPIUnreachableFromClient IntervalSource = \"APIUnreachableFromClient\"\n\tSourceMachine                  IntervalSource = \"MachineMonitor\"\n\n\tSourceGenerationMonitor IntervalSource = \"GenerationMonitor\"\n\n\tSourceStaticPodInstallMonitor  IntervalSource = \"StaticPodInstallMonitor\"\n\tSourceCPUMonitor               IntervalSource = \"CPUMonitor\"\n\tSourceEtcdDiskCommitDuration   IntervalSource = \"EtcdDiskCommitDuration\"\n\tSourceEtcdDiskWalFsyncDuration IntervalSource = \"EtcdDiskWalFsyncDuration\"\n\tSourceTestBucket               IntervalSource = \"TestBucket\"\n\tKubeletPanic                   IntervalReason = \"KubeletPanic\"\n\tCrioPanic                      IntervalReason = \"CrioPanic\"\n)\n```\n\n```go\nconst EventDir = \"monitor-events\"\n```\n\n```go\nconst TimeFormat = \"Jan 02 15:04:05\"\n```\n\n## Variables\n\n```go\nvar (\n\t// PodLifecycleTransitionReasons are the reasons associated with non-overlapping pod lifecycle states.\n\t// A pod is logically identified by UID (I bet it's a name right now).\n\t// Pods don't exist before create and don't exist after delete.\n\t// Between those two states, each of these reasons can be ordered by time and used to create a contiguous view\n\t// into the lifecycle of a pod.\n\tPodLifecycleTransitionReasons = sets.New[IntervalReason](\n\t\tPodReasonCreated,\n\t\tPodReasonScheduled,\n\t\tPodReasonGracefulDeleteStarted,\n\t\tPodReasonDeleted,\n\t)\n\n\t// ContainerLifecycleTransitionReasons are the reasons associated with non-overlapping container lifecycle states.\n\t// The logical beginning and end are based on ContainerWait and ContainerExit.\n\t// A container is logically identified by a Pod plus a container name.\n\tContainerLifecycleTransitionReasons = sets.New[IntervalReason](\n\t\tContainerReasonContainerWait,\n\t\tContainerReasonContainerStart,\n\t\tContainerReasonContainerExit,\n\t)\n\n\t// ContainerReadinessTransitionReasons are the reasons associated with non-overlapping container readiness states.\n\t// A container is logically identified by a Pod plus a container name.\n\t// The logical beginning and end are based on ContainerStart and ContainerExit, with initial state of ready=false and final state of ready=false.\n\t// Each of these reasons can be ordered by time and used to create a contiguous view into the lifecycle of a pod.\n\tContainerReadinessTransitionReasons = sets.New[IntervalReason](\n\t\tContainerReasonReady,\n\t\tContainerReasonNotReady,\n\t)\n\n\tKubeletReadinessCheckReasons = sets.New[IntervalReason](\n\t\tContainerReasonReadinessFailed,\n\t\tContainerReasonReadinessErrored,\n\t\tContainerReasonStartupProbeFailed,\n\t)\n)\n```\n\n## Functions\n\n```go\nfunc AlertFrom(locatorParts map[string]string) string\n```\n\n```go\nfunc AnnotationsFromMessage(message string) map[AnnotationKey]string\n```\n\n```go\nfunc BackendDisruptionNameFromLocator(locator Locator) string\n```\n\n```go\nfunc BackendDisruptionSeconds(backendDisruptionName string, events Intervals) (time.Duration, []string)\n```\nBackendDisruptionSeconds return duration of disruption observed (rounded to nearest second), disruptionMessages, and New or Reused connection type.\n\n```go\nfunc E2ETestFromLocator(l Locator) (string, bool)\n```\n\n```go\nfunc GetNodeRoles(event Interval) string\n```\nGetNodeRoles extract the node roles from the event message.\n\n```go\nfunc GetOperatorConditionHumanMessage(s *configv1.ClusterOperatorStatusCondition, prefix string) string\n```\nGetOperatorConditionHumanMessage constructs a human-readable message from a given ClusterOperatorStatusCondition with a given prefix\n\n```go\nfunc GetOperatorConditionStatus(interval Interval) *configv1.ClusterOperatorStatusCondition\n```\nGetOperatorConditionStatus reconstructs a ClusterOperatorStatusCondition from an interval.\n\n```go\nfunc HasRealLoadBalancer(eventInterval Interval) bool\n```\n\n```go\nfunc IsDisruptionEvent(eventInterval Interval) bool\n```\n\n```go\nfunc IsE2ETest(l Locator) bool\n```\n\n```go\nfunc IsErrorEvent(eventInterval Interval) bool\n```\nIsErrorEvent returns true if the eventInterval is an Error\n\n```go\nfunc IsInE2ENamespace(eventInterval Interval) bool\n```\nIsInE2ENamespace returns true if the eventInterval is in an e2e namespace\n\n```go\nfunc IsInfoEvent(eventInterval Interval) bool\n```\nIsInfoEvent returns true if the eventInterval is an Info\n\n```go\nfunc IsNode(locator Locator) bool\n```\n\n```go\nfunc IsWarningEvent(eventInterval Interval) bool\n```\nIsWarningEvent returns true if the eventInterval is an Warning\n\n```go\nfunc LocatorParts(locator string) map[string]string\n```\nTODO: remove all uses\n\n```go\nfunc NamespaceFrom(locatorParts map[string]string) string\n```\n\n```go\nfunc NamespaceFromLocator(locator Locator) string\n```\n\n```go\nfunc NodeFrom(locatorParts map[string]string) string\n```\n\n```go\nfunc NodeFromLocator(locator string) (string, bool)\n```\n\n```go\nfunc NodeLeaseBackoff(eventInterval Interval) bool\n```\n\n```go\nfunc NodeUpdate(eventInterval Interval) bool\n```\n\n```go\nfunc NonAnnotationMessage(message string) string\n```\n\n```go\nfunc NonUniquePodLocatorFrom(locator Locator) string\n```\nNonUniquePodLocatorFrom produces an inexact locator based on namespace and name.  This is useful when dealing with events that are produced that do not contain UIDs.  Ultimately, we should use UIDs everywhere, but this is will keep some our matching working until then.\n\n```go\nfunc OperatorFrom(locatorParts map[string]string) string\n```\n\n```go\nfunc PhaseFrom(message string) string\n```\n\n```go\nfunc ThisDisruptionInstanceFrom(locatorParts map[string]string) string\n```\n\n## Types\n\n```go\ntype AnnotationKey string\n```\n\n```go\nconst (\n\tAnnotationAlertState         AnnotationKey = \"alertstate\"\n\tAnnotationState              AnnotationKey = \"state\"\n\tAnnotationSeverity           AnnotationKey = \"severity\"\n\tAnnotationReason             AnnotationKey = \"reason\"\n\tAnnotationContainerExitCode  AnnotationKey = \"code\"\n\tAnnotationCause              AnnotationKey = \"cause\"\n\tAnnotationConfig             AnnotationKey = \"config\"\n\tAnnotationContainer          AnnotationKey = \"container\"\n\tAnnotationImage              AnnotationKey = \"image\"\n\tAnnotationInteresting        AnnotationKey = \"interesting\"\n\tAnnotationCount              AnnotationKey = \"count\"\n\tAnnotationNode               AnnotationKey = \"node\"\n\tAnnotationEtcdLocalMember    AnnotationKey = \"local-member-id\"\n\tAnnotationEtcdTerm           AnnotationKey = \"term\"\n\tAnnotationEtcdLeader         AnnotationKey = \"leader\"\n\tAnnotationPreviousEtcdLeader AnnotationKey = \"prev-leader\"\n\tAnnotationPathological       AnnotationKey = \"pathological\"\n\tAnnotationConstructed        AnnotationKey = \"constructed\"\n\tAnnotationPhase              AnnotationKey = \"phase\"\n\tAnnotationPreviousPhase      AnnotationKey = \"previousPhase\"\n\tAnnotationIsStaticPod        AnnotationKey = \"mirrored\"\n\t// TODO this looks wrong. seems like it ought to be set in the to/from\n\tAnnotationDuration         AnnotationKey = \"duration\"\n\tAnnotationRequestAuditID   AnnotationKey = \"request-audit-id\"\n\tAnnotationRoles            AnnotationKey = \"roles\"\n\tAnnotationStatus           AnnotationKey = \"status\"\n\tAnnotationCondition        AnnotationKey = \"condition\"\n\tAnnotationPercentage       AnnotationKey = \"percentage\"\n\tAnnotationPriority         AnnotationKey = \"priority\"\n\tAnnotationPreviousPriority AnnotationKey = \"prev-priority\"\n\tAnnotationVIP              AnnotationKey = \"vip\"\n)\n```\n\n```go\ntype BackendConnectionType string\n```\n\n```go\nconst (\n\tNewConnectionType    BackendConnectionType = \"new\"\n\tReusedConnectionType BackendConnectionType = \"reused\"\n)\n```\n\n```go\nfunc DisruptionConnectionTypeFrom(locatorParts map[string]string) BackendConnectionType\n```\n\n```go\ntype ByTimeWithNamespacedPods []Interval\n```\n\n```go\nfunc (intervals ByTimeWithNamespacedPods) Len() int\n```\n\n```go\nfunc (intervals ByTimeWithNamespacedPods) Less(i, j int) bool\n```\n\n```go\nfunc (intervals ByTimeWithNamespacedPods) Swap(i, j int)\n```\n\n```go\ntype Condition struct {\n\tLevel IntervalLevel\n\n\tLocator Locator\n\tMessage Message\n}\n```\n\n```go\nfunc (o *Condition) DeepCopy() *Condition\n```\n\n```go\ntype ConstructionOwner string\n```\nConstructionOwner was originally meant to signify that an interval was derived from other intervals. This allowed for the possibility of testing interval generation by feeding in only source intervals, and checking what was generated. TODO: likely want to drop this concept in favor of Source, plus a flag automatically applied to any intervals coming back from the monitor test call to generate calculated intervals. Source will replace the use of what constructed the interval, and the flag will allow us to see what is derived and what isn't.\n\n```go\ntype ContainerReference struct {\n\tPod           PodReference\n\tContainerName string\n}\n```\n\n```go\nfunc ContainerFrom(locator Locator) ContainerReference\n```\n\n```go\nfunc (r ContainerReference) ToLocator() Locator\n```\n\n```go\ntype EventIntervalMatchesFunc func(eventInterval Interval) bool\n```\nEventIntervalMatchesFunc is a function for matching eventIntervales\n\n```go\nfunc AlertFiring() EventIntervalMatchesFunc\n```\n\n```go\nfunc AlertPending() EventIntervalMatchesFunc\n```\n\n```go\nfunc And(filters ...EventIntervalMatchesFunc) EventIntervalMatchesFunc\n```\n\n```go\nfunc ContainsAllParts(matchers map[string][]*regexp.Regexp) EventIntervalMatchesFunc\n```\nContainsAllParts ensures that all listed key match at least one of the values.\n\n```go\nfunc EndedAfter(limit time.Time) EventIntervalMatchesFunc\n```\n\n```go\nfunc IsEventForBackendDisruptionName(backendDisruptionName string) EventIntervalMatchesFunc\n```\n\n```go\nfunc IsEventForLocator(locator Locator) EventIntervalMatchesFunc\n```\n\n```go\nfunc IsForDisruptionBackend(backend string) EventIntervalMatchesFunc\n```\n\n```go\nfunc IsInNamespaces(namespaces sets.String) EventIntervalMatchesFunc\n```\n\n```go\nfunc Not(filter EventIntervalMatchesFunc) EventIntervalMatchesFunc\n```\n\n```go\nfunc NotContainsAllParts(matchers map[string][]*regexp.Regexp) EventIntervalMatchesFunc\n```\nNotContainsAllParts returns a function that returns false if any key matches.\n\n```go\nfunc Or(filters ...EventIntervalMatchesFunc) EventIntervalMatchesFunc\n```\n\n```go\nfunc StartedBefore(limit time.Time) EventIntervalMatchesFunc\n```\n\n```go\ntype InstanceKey struct {\n\tNamespace string\n\tName      string\n\tUID       string\n}\n```\n\n```go\ntype InstanceMap map[InstanceKey]runtime.Object\n```\n\n```go\ntype Interval struct {\n\t// Deprecated: We hope to fold this into Interval itself.\n\tCondition\n\tSource IntervalSource\n\n\t// Display is a very coarse hint to any UI that this event was considered important enough to *possibly* be displayed by the source that produced it.\n\t// UI may apply further filtering.\n\tDisplay bool\n\n\tFrom time.Time\n\tTo   time.Time\n}\n```\n\n```go\nfunc (o *Interval) DeepCopy() *Interval\n```\n\n```go\nfunc (i Interval) String() string\n```\n\n```go\ntype IntervalBuilder struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewInterval(source IntervalSource, level IntervalLevel) *IntervalBuilder\n```\nNewInterval creates a new interval builder. Source is an indicator of what created this interval, used for safely identifying intervals we're looking for, and for grouping in charts.\n\n```go\nfunc (b *IntervalBuilder) Build(from, to time.Time) Interval\n```\nBuild creates the final interval with a mandatory from/to timestamp. Zero value times are allowed to indicate cases when the from or to is not known. This situation happens when the monitor doesn't observe a state change: imagine intervals for tracking graceful shutdown. If the monitor is stopped before the shutdown completes, it is incorrect to indicate a To time of \"now\". It is accurate to indicate \"open\" by using a zero value time.\n\n```go\nfunc (b *IntervalBuilder) BuildCondition() Condition\n```\nDeprecated: Use Build for a full Interval, we hope to remove Condition entirely and bubble it up into Interval directly.\n\n```go\nfunc (b *IntervalBuilder) BuildNow() Interval\n```\nBuildNow creates the final interval with a from/to timestamp of now.\n\n```go\nfunc (b *IntervalBuilder) Display() *IntervalBuilder\n```\nDisplay is a coarse grained hint that any UI should display this interval to a user.\n\n```go\nfunc (b *IntervalBuilder) Locator(locator Locator) *IntervalBuilder\n```\n\n```go\nfunc (b *IntervalBuilder) Message(mb *MessageBuilder) *IntervalBuilder\n```\n\n```go\ntype IntervalFilter func(i Interval) bool\n```\n\n```go\ntype IntervalFilters []IntervalFilter\n```\n\n```go\nfunc (filters IntervalFilters) All(i Interval) bool\n```\n\n```go\nfunc (filters IntervalFilters) Any(i Interval) bool\n```\n\n```go\ntype IntervalLevel int\n```\n\n```go\nconst (\n\tInfo IntervalLevel = iota\n\tWarning\n\tError\n)\n```\n\n```go\nfunc ConditionLevelFromString(s string) (IntervalLevel, error)\n```\n\n```go\nfunc (e IntervalLevel) String() string\n```\n\n```go\ntype IntervalReason string\n```\n\n```go\nconst (\n\tIPTablesNotPermitted IntervalReason = \"iptables-operation-not-permitted\"\n\n\tDisruptionBeganEventReason              IntervalReason = \"DisruptionBegan\"\n\tDisruptionEndedEventReason              IntervalReason = \"DisruptionEnded\"\n\tDisruptionSamplerOutageBeganEventReason IntervalReason = \"DisruptionSamplerOutageBegan\"\n\tGracefulAPIServerShutdown               IntervalReason = \"GracefulAPIServerShutdown\"\n\tIncompleteAPIServerShutdown             IntervalReason = \"IncompleteAPIServerShutdown\"\n\n\tHttpClientConnectionLost IntervalReason = \"HttpClientConnectionLost\"\n\n\tPodPendingReason               IntervalReason = \"PodIsPending\"\n\tPodNotPendingReason            IntervalReason = \"PodIsNotPending\"\n\tPodReasonCreated               IntervalReason = \"Created\"\n\tPodReasonGracefulDeleteStarted IntervalReason = \"GracefulDelete\"\n\tPodReasonForceDelete           IntervalReason = \"ForceDelete\"\n\tPodReasonDeleted               IntervalReason = \"Deleted\"\n\tPodReasonScheduled             IntervalReason = \"Scheduled\"\n\tPodReasonEvicted               IntervalReason = \"Evicted\"\n\tPodReasonPreempted             IntervalReason = \"Preempted\"\n\tPodReasonFailed                IntervalReason = \"Failed\"\n\tPodReasonReady                 IntervalReason = \"PodReady\"\n\tPodReasonNotReady              IntervalReason = \"PodNotReady\"\n\n\tContainerReasonContainerExit      IntervalReason = \"ContainerExit\"\n\tContainerReasonContainerStart     IntervalReason = \"ContainerStart\"\n\tContainerReasonContainerWait      IntervalReason = \"ContainerWait\"\n\tContainerReasonReadinessFailed    IntervalReason = \"ReadinessFailed\"\n\tContainerReasonReadinessErrored   IntervalReason = \"ReadinessErrored\"\n\tContainerReasonStartupProbeFailed IntervalReason = \"StartupProbeFailed\"\n\tContainerReasonReady              IntervalReason = \"Ready\"\n\tContainerReasonRestarted          IntervalReason = \"Restarted\"\n\tContainerReasonNotReady           IntervalReason = \"NotReady\"\n\tTerminationStateCleared           IntervalReason = \"TerminationStateCleared\"\n\n\tPodReasonDeletedBeforeScheduling IntervalReason = \"DeletedBeforeScheduling\"\n\tPodReasonDeletedAfterCompletion  IntervalReason = \"DeletedAfterCompletion\"\n\n\tNodeUpdateReason                IntervalReason = \"NodeUpdate\"\n\tNodeNotReadyReason              IntervalReason = \"NotReady\"\n\tNodeFailedLease                 IntervalReason = \"FailedToUpdateLease\"\n\tNodeUnexpectedReadyReason       IntervalReason = \"UnexpectedNotReady\"\n\tNodeUnexpectedUnreachableReason IntervalReason = \"UnexpectedUnreachable\"\n\tNodeUnreachable                 IntervalReason = \"Unreachable\"\n\t// Kubelet tries to get lease five times and then gives up\n\tNodeFailedLeaseBackoff IntervalReason = \"FailedToUpdateLeaseInBackoff\"\n\tNodeDiskPressure       IntervalReason = \"NodeDiskPressure\"\n\tNodeNoDiskPressure     IntervalReason = \"NodeNoDiskPressure\"\n\tNodeDeleted            IntervalReason = \"Deleted\"\n\n\tMachineConfigChangeReason  IntervalReason = \"MachineConfigChange\"\n\tMachineConfigReachedReason IntervalReason = \"MachineConfigReached\"\n\n\tMachineCreated      IntervalReason = \"MachineCreated\"\n\tMachineDeletedInAPI IntervalReason = \"MachineDeletedInAPI\"\n\tMachinePhaseChanged IntervalReason = \"MachinePhaseChange\"\n\tMachinePhase        IntervalReason = \"MachinePhase\"\n\n\tOnPremHaproxyDetectsDown  IntervalReason = \"OnPremHaproxyDetectsDown\"\n\tOnPremHaproxyStatusChange IntervalReason = \"OnPremHaproxyStatusChange\"\n\tOnPremLBPriorityChange    IntervalReason = \"OnPremLBPriorityChange\"\n\tOnPremLBTookVIP           IntervalReason = \"OnPremLBTookVIP\"\n\tOnPremLBLostVIP           IntervalReason = \"OnPremLBLostVIP\"\n\n\tTimeout IntervalReason = \"Timeout\"\n\n\tE2ETestStarted  IntervalReason = \"E2ETestStarted\"\n\tE2ETestFinished IntervalReason = \"E2ETestFinished\"\n\n\tCloudMetricsExtrenuous                IntervalReason = \"CloudMetricsExtrenuous\"\n\tCloudMetricsLBAvailability            IntervalReason = \"CloudMetricsLBAvailability\"\n\tCloudMetricsLBHealthEvent             IntervalReason = \"CloudMetricsLBHealthEvent\"\n\tFailedToDeleteCGroupsPath             IntervalReason = \"FailedToDeleteCGroupsPath\"\n\tFailedToAuthenticateWithOpenShiftUser IntervalReason = \"FailedToAuthenticateWithOpenShiftUser\"\n\tFailedContactingAPIReason             IntervalReason = \"FailedContactingAPI\"\n\n\tUnhealthyReason IntervalReason = \"Unhealthy\"\n\n\tUpgradeStartedReason  IntervalReason = \"UpgradeStarted\"\n\tUpgradeVersionReason  IntervalReason = \"UpgradeVersion\"\n\tUpgradeRollbackReason IntervalReason = \"UpgradeRollback\"\n\tUpgradeFailedReason   IntervalReason = \"UpgradeFailed\"\n\tUpgradeCompleteReason IntervalReason = \"UpgradeComplete\"\n\n\tNodeInstallerReason IntervalReason = \"NodeInstaller\"\n\n\t// client metrics show error connecting to the kube-apiserver\n\tAPIUnreachableFromClientMetrics IntervalReason = \"APIUnreachableFromClientMetrics\"\n\n\tLeaseAcquiring        IntervalReason = \"Acquiring\"\n\tLeaseAcquiringStarted IntervalReason = \"StartedAcquiring\"\n\tLeaseAcquired         IntervalReason = \"Acquired\"\n\n\tReasonBadOperatorApply  IntervalReason = \"BadOperatorApply\"\n\tReasonKubeAPIServer500s IntervalReason = \"KubeAPIServer500s\"\n\n\tReasonHighGeneration    IntervalReason = \"HighGeneration\"\n\tReasonInvalidGeneration IntervalReason = \"GenerationViolation\"\n\n\tReasonEtcdBootstrap     IntervalReason = \"EtcdBootstrap\"\n\tReasonProcessDumpedCore IntervalReason = \"ProcessDumpedCore\"\n)\n```\n\n```go\nfunc ConstructionOwnerFrom(message string) IntervalReason\n```\n\n```go\nfunc ReasonFrom(message string) IntervalReason\n```\n\n```go\nfunc (r IntervalReason) String() string\n```\n\n```go\ntype IntervalSource string\n```\nIntervalSource is used to type/categorize all intervals based on what created them. This is intended to be used to group, and when combined with the display flag, signal that they should be visible by default in the UIs that render interval charts.\n\n```go\ntype Intervals []Interval\n```\n\n```go\nfunc (intervals Intervals) Clamp(from, to time.Time)\n```\nClamp sets all zero value From or To fields to from or to.\n\n```go\nfunc (intervals Intervals) Cut(from, to time.Time) Intervals\n```\nCut creates a copy of intervals where all events (empty To) are within \\[from,to) and all intervals that overlap \\[from,to) are included, but with their from/to fields limited to that range.\n\n```go\nfunc (intervals Intervals) Duration(minCurrentDuration time.Duration) time.Duration\n```\nDuration returns the sum of all intervals in the range. If To is less than or equal to From, 0 is used instead (use Clamp() if open intervals should be not considered instant). minDuration is the smallest duration to add.  If a duration is less than the minDuration, then the minDuration is used instead.  This is useful for measuring samples. For example, consider a case of one second polling for server availability. If a sample fails, you don't definitively know whether it was down just after t-1s or just before t. On average, it would be 500ms, but a useful minimum in this case could be 1s.\n\n```go\nfunc (intervals Intervals) Filter(eventFilterMatches EventIntervalMatchesFunc) Intervals\n```\nFilter returns a copy of intervals with only intervals that match the provided function.\n\n```go\nfunc (intervals Intervals) Len() int\n```\n\n```go\nfunc (intervals Intervals) Less(i, j int) bool\n```\n\n```go\nfunc (intervals Intervals) Slice(from, to time.Time) Intervals\n```\nSlice works on a sorted Intervals list and returns the set of intervals The intervals start from the first Interval that ends AFTER the argument.From. The last interval is one before the first Interval that starts before the argument.To The zero value will return all elements. If intervals is unsorted the result is undefined. This runs in O(n).\n\n```go\nfunc (intervals Intervals) Strings() []string\n```\nStrings returns the result of String() on each included interval.\n\n```go\nfunc (intervals Intervals) Swap(i, j int)\n```\n\n```go\ntype Locator struct {\n\tType LocatorType `json:\"type\"`\n\n\t// annotations will include the Reason and Cause under their respective keys\n\tKeys map[LocatorKey]string `json:\"keys\"`\n}\n```\n\n```go\nfunc LocatePod(pod *corev1.Pod) Locator\n```\n\n```go\nfunc (o *Locator) DeepCopy() *Locator\n```\n\n```go\nfunc (i Locator) HasKey(k LocatorKey) bool\n```\n\n```go\nfunc (i Locator) OldLocator() string\n```\n\n```go\ntype LocatorBuilder struct {\n\t// contains filtered or unexported fields\n}\n```\nLocatorBuilder is used to create locators. We do not want to allow chaining of locators however as this has led to illegal definitions of locators in the past. (such as node + namespace) Instead the builder serves primarily as a place to store the builder functions.\n\n```go\nfunc NewLocator() *LocatorBuilder\n```\n\n```go\nfunc (b *LocatorBuilder) AlertFromPromSampleStream(alert *model.SampleStream) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) Build() Locator\n```\n\n```go\nfunc (b *LocatorBuilder) CloudNodeMetric(nodeName string, metric string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) ClusterOperator(name string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) ClusterVersion(cv *v1.ClusterVersion) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) ContainerFromNames(namespace, podName, uid, containerName string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) ContainerFromPod(pod *corev1.Pod, containerName string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) DaemonSetFromName(namespace, daemonSetName string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) DeploymentFromName(namespace, deploymentName string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) Disruption(backendDisruptionName, thisInstanceName, loadBalancer, protocol, target string, connectionType BackendConnectionType) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) DisruptionRequiredOnly(backendDisruptionName, thisInstanceName string) Locator\n```\nDisruptionRequiredOnly takes only the logically required data for backend-disruption.json and codifies it. backendDisruptionName is the value used to store and locate historical data related to the amount of disruption. thisInstanceName is used to show on a timeline which connection failed. For instance, the backendDisruptionName may be internal-load-balancer and the thisInstanceName may include, 1. from worker-a 2. new connections 3. to IP 4. this protocol\n\n```go\nfunc (b *LocatorBuilder) E2ETest(testName string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) EtcdMemberFromNames(nodeName, memberName string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) KubeAPIServerWithLB(loadBalancer string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) KubeEvent(event *corev1.Event) Locator\n```\nTODO decide whether we want to allow \"random\" locator keys.  deads2k is -1 on random locator keys and thinks we should enumerate every possible key we special case.\n\n```go\nfunc (b *LocatorBuilder) KubeletSyncLoopPLEG(node, ns, podName, eventType string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) KubeletSyncLoopProbe(node, ns, podName, probeType string) Locator\n```\nKubeletSyncLoopProbe constructs a locator from a Kubelet SyncLoop probe event, typically kubelet log prints the events as follows: \"SyncLoop (probe)\" probe=\"readiness\" status=\"ready\" pod=\"openshift-etcd/etcd-ci-op-bzbjn2bk-206af-gfdsw-master-2\"\n\n```go\nfunc (b *LocatorBuilder) LocateDisruptionCheck(backendDisruptionName, thisInstanceName string, connectionType BackendConnectionType) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) LocateNamespace(namespaceName string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) LocateRouteForDisruptionCheck(backendDisruptionName, thisInstanceName, ns, name string, connectionType BackendConnectionType) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) LocateServer(serverName, nodeName, namespace, podName string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) MachineFromName(machineName string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) NodeFromName(nodeName string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) NodeFromNameWithRole(nodeName, nodeRole string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) NodeFromNameWithRow(nodeName, row string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) PodFromNames(namespace, podName, uid string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) PodFromPod(pod *corev1.Pod) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) PrometheusTargetDownFromPromSampleStream(sample *model.SampleStream) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) StatefulSetFromName(namespace, statefulSetName string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) StaticPodInstall(node, podType string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) TestBucket(bucketName string) Locator\n```\n\n```go\nfunc (b *LocatorBuilder) WithAPIUnreachableFromClient(metric model.Metric, serviceNetworkIP, nodeName, nodeRole string) Locator\n```\n\n```go\ntype LocatorKey string\n```\n\n```go\nconst (\n\tLocatorClusterOperatorKey LocatorKey = \"clusteroperator\"\n\tLocatorClusterVersionKey  LocatorKey = \"clusterversion\"\n\tLocatorNamespaceKey       LocatorKey = \"namespace\"\n\tLocatorDeploymentKey      LocatorKey = \"deployment\"\n\tLocatorDaemonSetKey       LocatorKey = \"daemonset\"\n\tLocatorStatefulSetKey     LocatorKey = \"statefulset\"\n\tLocatorNodeKey            LocatorKey = \"node\"\n\tLocatorMachineKey         LocatorKey = \"machine\"\n\tLocatorNodeRoleKey        LocatorKey = \"node-role\"\n\tLocatorEtcdMemberKey      LocatorKey = \"etcd-member\"\n\tLocatorNameKey            LocatorKey = \"name\"\n\tLocatorHmsgKey            LocatorKey = \"hmsg\"\n\tLocatorInstanceKey        LocatorKey = \"instance\"\n\tLocatorPodKey             LocatorKey = \"pod\"\n\tLocatorUIDKey             LocatorKey = \"uid\"\n\tLocatorMirrorUIDKey       LocatorKey = \"mirror-uid\"\n\tLocatorMetricsPathKey     LocatorKey = \"metrics-path\"\n\tLocatorServiceKey         LocatorKey = \"service\"\n\tLocatorContainerKey       LocatorKey = \"container\"\n\tLocatorAlertKey           LocatorKey = \"alert\"\n\tLocatorRouteKey           LocatorKey = \"route\"\n\t// LocatorBackendDisruptionNameKey holds the value used to store and locate historical data related to the amount of disruption.\n\tLocatorBackendDisruptionNameKey LocatorKey = \"backend-disruption-name\"\n\tLocatorDisruptionKey            LocatorKey = \"disruption\"\n\tLocatorE2ETestKey               LocatorKey = \"e2e-test\"\n\tLocatorLoadBalancerKey          LocatorKey = \"load-balancer\"\n\tLocatorConnectionKey            LocatorKey = \"connection\"\n\tLocatorProtocolKey              LocatorKey = \"protocol\"\n\tLocatorTargetKey                LocatorKey = \"target\"\n\tLocatorRowKey                   LocatorKey = \"row\"\n\tLocatorServerKey                LocatorKey = \"server\"\n\tLocatorMetricKey                LocatorKey = \"metric\"\n\n\tLocatorAPIUnreachableHostKey                  LocatorKey = \"host\"\n\tLocatorAPIUnreachableComponentKey             LocatorKey = \"component\"\n\tLocatorOnPremKubeapiUnreachableFromHaproxyKey LocatorKey = \"onprem-haproxy\"\n\tLocatorOnPremVIPMonitorKey                    LocatorKey = \"onprem-keepalived\"\n\n\tLocatorTypeKubeletSyncLoopProbeType LocatorKey = \"probe\"\n\tLocatorTypeKubeletSyncLoopPLEGType  LocatorKey = \"plegType\"\n\tLocatorStaticPodInstallType         LocatorKey = \"podType\"\n\tLocatorTestBucketKey                LocatorKey = \"test-bucket\"\n)\n```\n\n```go\ntype LocatorType string\n```\n\n```go\nconst (\n\tLocatorTypePod             LocatorType = \"Pod\"\n\tLocatorTypeContainer       LocatorType = \"Container\"\n\tLocatorTypeNode            LocatorType = \"Node\"\n\tLocatorTypeMachine         LocatorType = \"Machine\"\n\tLocatorTypeAlert           LocatorType = \"Alert\"\n\tLocatorTypeMetricsEndpoint LocatorType = \"MetricsEndpoint\"\n\tLocatorTypeClusterOperator LocatorType = \"ClusterOperator\"\n\tLocatorTypeDisruption      LocatorType = \"Disruption\"\n\tLocatorTypeKubeEvent       LocatorType = \"KubeEvent\"\n\tLocatorTypeE2ETest         LocatorType = \"E2ETest\"\n\tLocatorTypeAPIServer       LocatorType = \"APIServer\"\n\tLocatorTypeClusterVersion  LocatorType = \"ClusterVersion\"\n\tLocatorTypeKind            LocatorType = \"Kind\"\n\tLocatorTypeCloudMetrics    LocatorType = \"CloudMetrics\"\n\tLocatorTypeDeployment      LocatorType = \"Deployment\"\n\tLocatorTypeDaemonSet       LocatorType = \"DaemonSet\"\n\tLocatorTypeStatefulSet     LocatorType = \"StatefulSet\"\n\n\tLocatorTypeAPIUnreachableFromClient LocatorType = \"APIUnreachableFromClient\"\n\n\tLocatorTypeKubeletSyncLoopProbe LocatorType = \"KubeletSyncLoopProbe\"\n\tLocatorTypeKubeletSyncLoopPLEG  LocatorType = \"KubeletSyncLoopPLEG\"\n\tLocatorTypeStaticPodInstall     LocatorType = \"StaticPodInstall\"\n\tLocatorTypeTestBucket           LocatorType = \"TestBucket\"\n)\n```\n\n```go\ntype Message struct {\n\t// TODO: reason/cause both fields and annotations...\n\tReason       IntervalReason `json:\"reason\"`\n\tCause        string         `json:\"cause\"`\n\tHumanMessage string         `json:\"humanMessage\"`\n\n\t// annotations will include the Reason and Cause under their respective keys\n\tAnnotations map[AnnotationKey]string `json:\"annotations\"`\n}\n```\n\n```go\nfunc (o *Message) DeepCopy() *Message\n```\n\n```go\nfunc (i Message) OldMessage() string\n```\n\n```go\ntype MessageBuilder struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc ExpandMessage(prevMessage Message) *MessageBuilder\n```\nExpandMessage parses a message that was collapsed into a string to extract each annotation and the original message.\n\n```go\nfunc NewMessage() *MessageBuilder\n```\n\n```go\nfunc (m *MessageBuilder) Build() Message\n```\nBuild creates the final Message with all data assembled by this builder.\n\n```go\nfunc (m *MessageBuilder) BuildString() string\n```\nBuildString creates the final message as a flat single string. Each annotation is prepended in the form name/value, followed by the human message, if any.\n\n```go\nfunc (m *MessageBuilder) Cause(cause string) *MessageBuilder\n```\n\n```go\nfunc (m *MessageBuilder) Constructed(constructedBy ConstructionOwner) *MessageBuilder\n```\n\n```go\nfunc (m *MessageBuilder) HumanMessage(message string) *MessageBuilder\n```\nHumanMessage adds the human readable message. If called multiple times, the message is appended.\n\n```go\nfunc (m *MessageBuilder) HumanMessagef(messageFormat string, args ...interface{}) *MessageBuilder\n```\nHumanMessagef adds a formatted string to the human readable message. If called multiple times, the message is appended.\n\n```go\nfunc (m *MessageBuilder) Node(node string) *MessageBuilder\n```\n\n```go\nfunc (m *MessageBuilder) Reason(reason IntervalReason) *MessageBuilder\n```\n\n```go\nfunc (m *MessageBuilder) WithAnnotation(name AnnotationKey, value string) *MessageBuilder\n```\n\n```go\nfunc (m *MessageBuilder) WithAnnotations(annotations map[AnnotationKey]string) *MessageBuilder\n```\n\n```go\ntype NamespacedReference struct {\n\tNamespace string\n\tName      string\n\tUID       string\n}\n```\n\n```go\ntype PodReference struct {\n\tNamespacedReference\n}\n```\nTODO: delete all these\n\n```go\nfunc PodFrom(locator Locator) PodReference\n```\nPodFrom is used to strip down a locator to just a pod. (as it may contain additional keys like container or node) that we do not want for some uses.\n\n```go\nfunc (r PodReference) ToLocator() Locator\n```\n\n```go\ntype Recorder interface {\n\tRecorderReader\n\tRecorderWriter\n}\n```\nTODO most consumers only need writers or readers.  switch.\n\n```go\ntype RecorderReader interface {\n\t// Intervals returns a sorted snapshot of intervals in the selected timeframe\n\tIntervals(from, to time.Time) Intervals\n\t// CurrentResourceState returns a list of all known resources of a given type at the instant called.\n\tCurrentResourceState() ResourcesMap\n}\n```\n\n```go\ntype RecorderWriter interface {\n\t// RecordResource stores a resource for later serialization.  Deletion is not tracked, so this can be used\n\t// to determine the final state of resource that are deleted in a namespace.\n\t// Annotations are added to indicate number of updates and the number of recreates.\n\tRecordResource(resourceType string, obj runtime.Object)\n\n\tRecord(conditions ...Condition)\n\tRecordAt(t time.Time, conditions ...Condition)\n\n\tAddIntervals(eventIntervals ...Interval)\n\tStartInterval(interval Interval) int\n\tEndInterval(startedInterval int, t time.Time) *Interval\n}\n```\n\n```go\ntype ResourcesMap map[string]InstanceMap\n```\n\n","path":"github.com/openshift/origin/pkg/monitor/monitorapi","name":"monitorapi","synopsis":"","isRedistributable":true}
