saphanareceiver

package module
v0.101.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 21 Imported by: 4

README

SAP HANA Receiver

Status
Stability development: metrics
Distributions []
Issues Open issues Closed issues
Code Owners @dehaansa

This receiver can fetch stats from a SAP HANA instance. It leverages the driver written by SAP for connecting to SAP HANA with the golang sql module to execute several monitoring queries.

Prerequisites

The receiver is intended to support SAP HANA version 2, older versions have not been tested.

A monitoring user requires SELECT access to the relevant monitoring views. The following sql script should create a monitoring role and apply it to a monitoring user if executed by a user with sufficient permissions connected to the SAP HANA instance.

--Create the user
CREATE RESTRICTED USER otel_monitoring_user PASSWORD <password>;

--Enable user login
ALTER USER otel_monitoring_user ENABLE CLIENT CONNECT;

--Create the monitoring role
CREATE ROLE OTEL_MONITORING;

--Grant permissions to the relevant views
GRANT CATALOG READ TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_BACKUP_CATALOG TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_BLOCKED_TRANSACTIONS TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_CONNECTIONS TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_CS_ALL_COLUMNS TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_CS_TABLES TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_DATABASE TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_DISKS TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_HOST_RESOURCE_UTILIZATION TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_LICENSES TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_RS_TABLES TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_SERVICE_COMPONENT_MEMORY TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_SERVICE_MEMORY TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_SERVICE_REPLICATION TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_SERVICE_STATISTICS TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_SERVICE_THREADS TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_SERVICES TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_VOLUME_IO_TOTAL_STATISTICS TO OTEL_MONITORING;
GRANT SELECT ON SYS.M_WORKLOAD TO OTEL_MONITORING;
GRANT SELECT ON _SYS_STATISTICS.STATISTICS_CURRENT_ALERTS TO OTEL_MONITORING;

--Add the OTEL_MONITOR role to the monitoring user
GRANT OTEL_MONITORING TO otel_monitoring_user;

Configuration

ℹ This receiver is in beta and configuration fields are subject to change.

The following settings are required:

  • endpoint (default: localhost:33015): The hostname/IP address and port of the SAP HANA instance
  • username
  • password

The following settings are optional:

  • collection_interval (default = 60s): This receiver runs on an interval. Each time it runs, it queries memcached, creates metrics, and sends them to the next consumer. The collection_interval configuration option tells this receiver the duration between runs. This value must be a string readable by Golang's ParseDuration function (example: 1h30m). Valid time units are ns, us (or µs), ms, s, m, h.
  • initial_delay (default = 1s): defines how long this receiver waits before starting.
  • tls:
    • insecure (default = true): whether to disable client transport security for the exporter's connection.
    • ca_file: path to the CA cert. For a client this verifies the server certificate. Should only be used if insecure is set to false.
    • cert_file: path to the TLS cert to use for TLS required connections. Should only be used if insecure is set to false.
    • key_file: path to the TLS key to use for TLS required connections. Should only be used if insecure is set to false.

Example:

receivers:
  saphana:
    endpoint: "localhost:33015"
    collection_interval: 60s
    metrics:
      saphana.cpu.used:
        enabled: false

The full list of settings exposed for this receiver are documented here with detailed sample configurations here.

Metrics

Details about the metrics produced by this receiver can be found in metadata.yaml. Further details of the monitoring queries used to collect them may be found in queries.go.

If all of the metrics collected by a given monitoring query are marked as enabled: false in the receiver configration, the monitoring query will not be executed.

Documentation

Index

Constants

View Source
const (
	ErrNoUsername = "invalid config: missing username"
	ErrNoPassword = "invalid config: missing password" // #nosec G101 - not hardcoded credentials
)

Errors for missing required config parameters.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

NewFactory creates a factory for SAP HANA receiver.

Types

type Config

type Config struct {
	scraperhelper.ControllerConfig `mapstructure:",squash"`
	confignet.TCPAddrConfig        `mapstructure:",squash"`
	configtls.ClientConfig         `mapstructure:"tls,omitempty"`
	// MetricsBuilderConfig defines which metrics/attributes to enable for the scraper
	metadata.MetricsBuilderConfig `mapstructure:",squash"`

	Username string              `mapstructure:"username"`
	Password configopaque.String `mapstructure:"password"`
}

func (*Config) Validate

func (cfg *Config) Validate() error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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