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 ¶
- Variables
- func Close()
- func HostName() string
- func IsJmxClientError(err error) bool
- func Open(hostname, port, username, password string, opts ...Option) error
- func OpenNoAuth(hostname, port string, opts ...Option) error
- func OpenURL(connectionURL, username, password string, opts ...Option) error
- func Port() string
- func Query(objectPattern string, timeoutMillis int) (result map[string]interface{}, err error)
- type Option
- func WithConnectionURL(connectionURL string) Option
- func WithNrJmxTool(executablePath string) Option
- func WithRemoteProtocol() Option
- func WithRemoteStandAloneJBoss() Option
- func WithSSL(keyStore, keyStorePassword, trustStore, trustStorePassword string) Option
- func WithURIPath(uriPath string) Option
- func WithVerbose() Option
Constants ¶
This section is empty.
Variables ¶
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 ¶
IsJmxClientError identify if the error is jmx client error type
func OpenNoAuth ¶
OpenNoAuth executes a nrjmx command without user/pass using the given options.
Types ¶
type Option ¶
type Option func(config *connectionConfig)
Option sets an option on integration level.
func WithConnectionURL ¶
WithConnectionURL for specifying non standard(jmxrmi) path on jmx service uri
func WithNrJmxTool ¶
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 WithURIPath ¶
WithURIPath for specifying non standard(jmxrmi) path on jmx service uri