oracledbreceiver

package module
v0.114.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 21 Imported by: 6

README

Oracle DB receiver

Status
Stability alpha: metrics
Distributions contrib
Issues Open issues Closed issues
Code Owners @dmitryax, @crobert-1, @atoulme

This receiver collects metrics from an Oracle Database.

The receiver connects to a database host and performs periodically queries.

Getting Started

To use the OracleDB receiver you must define how to connect to your DB. This can be done in two ways, defined in the Primary and Secondary configuration option sections. Defining one of the two configurations is required. If both are defined, the primary option will be used.

Primary Configuration Option

Required options:

  • datasource: Oracle database connection string. Special characters must be encoded. Refer to Oracle Go Driver go_ora documentation for full connection string options.

Example:

receivers:
  oracledb:
    datasource: "oracle://otel:password@localhost:51521/XE"
Secondary Configuration Option

Required options:

  • endpoint: Endpoint used to connect to the OracleDB server. Must be in the format of host:port
  • password: Password for the OracleDB connection. Special characters are allowed.
  • service: OracleDB Service that the receiver should connect to.
  • username: Username for the OracleDB connection.

Example:

receivers:
  oracledb:
    endpoint: localhost:51521
    password: p@sswo%d
    service: XE
    username: otel
Optional Configuration Options
  • collection_interval (default = 10s): The interval at which metrics should be emitted by this receiver.
  • initial_delay (default = 1s): The initial time period this receiver waits before starting.
  • timeout (default = 0): Timeout for each Oracle DB request. Disabled by default.

Permissions

Depending on which metrics you collect, you will need to assign those permissions to the database user:

GRANT SELECT ON V_$SESSION TO <username>;
GRANT SELECT ON V_$SYSSTAT TO <username>;
GRANT SELECT ON V_$RESOURCE_LIMIT TO <username>;
GRANT SELECT ON DBA_TABLESPACES TO <username>;
GRANT SELECT ON DBA_DATA_FILES TO <username>;
GRANT SELECT ON DBA_TABLESPACE_USAGE_METRICS TO <username>;

Enabling metrics.

See documentation.

You can enable or disable selective metrics.

Example:

receivers:
  oracledb:
    datasource: "oracle://otel:password@localhost:51521/XE"
    metrics:
      oracledb.query.cpu_time:
        enabled: false
      oracledb.query.physical_read_requests:
        enabled: true

Documentation

Overview

Package oracledbreceiver implements a receiver collecting metrics from an Oracle datase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

NewFactory creates a new Oracle receiver factory.

Types

type Config

type Config struct {
	DataSource                     string `mapstructure:"datasource"`
	Endpoint                       string `mapstructure:"endpoint"`
	Password                       string `mapstructure:"password"`
	Service                        string `mapstructure:"service"`
	Username                       string `mapstructure:"username"`
	scraperhelper.ControllerConfig `mapstructure:",squash"`
	metadata.MetricsBuilderConfig  `mapstructure:",squash"`
}

func (Config) Validate added in v0.67.0

func (c 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