processmetrics

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package processmetrics provides process metrics collection capability for GC SAP Agent. This package is the landing space for process metrics collection in SAP GC Agent. This package abstracts the underlying metric collectors from the caller. The package is responsible for discovering the SAP applications running on this machine, and starting the relevant metric collectors in background. The package is responsible for the lifecycle of process metric specific jobs which involves:

  • Create asynchronous jobs using the configuration passed by the caller.
  • Monitor the job statuses and communicate with other components of GC SAP Agent.
  • Restart the jobs that fail to ensure we continue to push the metrics.
  • Send telemetry on aggregated job stats.

The package defines and consumes Collector interface. Each individual metric collection file - hana, netweaver, cluster etc need to implement this interface to leverage the common collectMetrics and sendMetrics functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMetricClient

func NewMetricClient(ctx context.Context) (cloudmonitoring.TimeSeriesCreator, error)

NewMetricClient is the production version that calls cloud monitoring API.

func Start

func Start(ctx context.Context, parameters Parameters) bool

Start starts collection if collect_process_metrics config option is enabled in the configuration. The function is a NO-OP if the config option is not enabled.

If the config option is enabled, start the metric collector jobs in the background and return control to the caller with return value = true.

Return false if the config option is not enabled.

Types

type Collector

type Collector interface {
	Collect(context.Context) []*mrpb.TimeSeries
}

Collector interface is SAP application specific metric collection logic. This needs to be implennted by application specific modules that want to leverage startMetricGroup functionality.

type CreateMetricClient

type CreateMetricClient func(ctx context.Context) (cloudmonitoring.TimeSeriesCreator, error)

CreateMetricClient provides an easily testable translation to the cloud monitoring API.

type Parameters

type Parameters struct {
	Config        *cpb.Configuration
	OSType        string
	MetricClient  CreateMetricClient
	SAPInstances  *sapb.SAPInstances
	BackOffs      *cloudmonitoring.BackOffIntervals
	HeartbeatSpec *heartbeat.Spec
	GCEService    sapdiscovery.GCEInterface
}

Parameters has parameters necessary to invoke Start().

type Properties

type Properties struct {
	SAPInstances  *sapb.SAPInstances // Optional for production use cases, used by unit tests.
	Config        *cpb.Configuration
	Client        cloudmonitoring.TimeSeriesCreator
	Collectors    []Collector
	HeartbeatSpec *heartbeat.Spec
}

Properties has necessary context for Metrics collection.

Directories

Path Synopsis
Package cluster provides functionality to collect SAP Linux cluster metrics.
Package cluster provides functionality to collect SAP Linux cluster metrics.
Package computeresources provides code for collection of compute resources metrics like CPU and memory per process for various Hana, Netweaver and SAP Control Processes.
Package computeresources provides code for collection of compute resources metrics like CPU and memory per process for various Hana, Netweaver and SAP Control Processes.
Package hana provides functionality to collect SAP HANA metrics.
Package hana provides functionality to collect SAP HANA metrics.
Package infra contains functions that gather infra level migration events for the SAP agent.
Package infra contains functions that gather infra level migration events for the SAP agent.
Package maintenance package is responsible for maintenance mode handling for the GC SAP Agent.
Package maintenance package is responsible for maintenance mode handling for the GC SAP Agent.
Package netweaver contains functions that gather SAP NetWeaver system metrics for the SAP agent.
Package netweaver contains functions that gather SAP NetWeaver system metrics for the SAP agent.
Package sapcontrol implements generic sapcontrol functions.
Package sapcontrol implements generic sapcontrol functions.
Package sapdiscovery discovers the SAP Applications and instances running on a given instance.
Package sapdiscovery discovers the SAP Applications and instances running on a given instance.
Package sapservice is responsible for collecting metrics for SAP service statuses using systemctl is-* cmd.
Package sapservice is responsible for collecting metrics for SAP service statuses using systemctl is-* cmd.

Jump to

Keyboard shortcuts

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