jmx

package
v3.6.7+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: Apache-2.0 Imports: 13 Imported by: 21

Documentation

Overview

Package jmx is a library to get metrics through JMX. It requires additional setup. Read https://github.com/newrelic/infra-integrations-sdk#jmx-support for instructions.

Package jmx is a library to get metrics through JMX. It requires additional setup. Read https://github.com/newrelic/infra-integrations-sdk#jmx-support for instructions.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBeanPattern = errors.New("cannot parse MBean glob pattern, valid: 'DOMAIN:BEAN'")
	ErrConnection  = jmxClientError("jmx endpoint connection error")
	// ErrJmxCmdRunning error returned when trying to Open and nrjmx command is still running
	ErrJmxCmdRunning = errors.New("JMX tool is already running")
)

Error vars to ease Query response handling.

Functions

func Close

func Close()

Close will finish the underlying nrjmx application by closing its standard input and canceling the execution afterwards to clean-up.

func IsJmxClientError

func IsJmxClientError(err error) bool

IsJmxClientError identify if the error is jmx client error type

func Open

func Open(hostname, port, username, password string, opts ...Option) error

Open executes a nrjmx command using the given options.

func OpenNoAuth

func OpenNoAuth(hostname, port string, opts ...Option) error

OpenNoAuth executes a nrjmx command without user/pass using the given options.

func OpenURL

func OpenURL(connectionURL, username, password string, opts ...Option) error

OpenURL executes a nrjmx command using the provided full connection URL and options.

func Query

func Query(objectPattern string, timeoutMillis int) (result map[string]interface{}, err error)

Query executes JMX query against nrjmx tool waiting up to timeout (in milliseconds)

Types

type Option

type Option func(config *connectionConfig)

Option sets an option on integration level.

func WithConnectionURL

func WithConnectionURL(connectionURL string) Option

WithConnectionURL for specifying non standard(jmxrmi) path on jmx service uri

func WithNrJmxTool

func WithNrJmxTool(executablePath string) Option

WithNrJmxTool for specifying non standard `nrjmx` tool executable location. Has less precedence than `NR_JMX_TOOL` environment variable.

func WithRemoteProtocol

func WithRemoteProtocol() Option

WithRemoteProtocol uses the remote JMX protocol URL (by default on JBoss Domain-mode).

func WithRemoteStandAloneJBoss

func WithRemoteStandAloneJBoss() Option

WithRemoteStandAloneJBoss uses the remote JMX protocol URL on JBoss Standalone-mode.

func WithSSL

func WithSSL(keyStore, keyStorePassword, trustStore, trustStorePassword string) Option

WithSSL for SSL connection configuration.

func WithURIPath

func WithURIPath(uriPath string) Option

WithURIPath for specifying non standard(jmxrmi) path on jmx service uri

func WithVerbose

func WithVerbose() Option

WithVerbose enables verbose mode for nrjmx.

Jump to

Keyboard shortcuts

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