Documentation ¶
Index ¶
Constants ¶
const (
// Namespace tells prometheus to export the metrics inside of a specific namespace
Namespace = "jolokia"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Metrics []MetricMapping `json:"metrics"`
}
Config is holding a list of metrics that should be exported
func LoadConfig ¶
LoadConfig reads a file and returns the contained config
type Exporter ¶
type Exporter struct { URI string // contains filtered or unexported fields }
Exporter exports jolokia metrics for prometheus.
func NewExporter ¶
func NewExporter(logger log.Logger, config *Config, namespace string, insecure bool, uri, basicAuthUser, basicAuthPassword string) (*Exporter, error)
NewExporter returns an initialized Exporter.
func (*Exporter) Collect ¶
func (e *Exporter) Collect(ch chan<- prometheus.Metric)
Collects metrics, implements prometheus.Collector.
func (*Exporter) Describe ¶
func (e *Exporter) Describe(ch chan<- *prometheus.Desc)
Describe describes all the metrics ever exported by the jolokia endpoint exporter. It implements prometheus.Collector.
type MetricMapping ¶
type MetricMapping struct { Source MetricSource `json:"source"` Target string `json:"target"` }
A MetricMapping is the assignment of a JMX source path to a target prom key name
type MetricSource ¶
type MetricSource struct { Mbean string `json:"mbean"` Attribute string `json:"attribute"` Path string `json:"path"` }
MetricSource defines what path the metric should be load from
type NestedValue ¶
type NestedValue map[string]json.RawMessage
NestedValue is holding a struct of information returned by jolokia
type Request ¶
type Request []RequestMetric
Request is a jolokia request holding a slice of RequestMetrics
type RequestMetric ¶
type RequestMetric struct { Type string `json:"type"` Attribute string `json:"attribute,omitempty"` Mbean string `json:"mbean"` Path string `json:"path,omitempty"` }
RequestMetric holds the info for jolokia what to export
func (RequestMetric) String ¶
func (m RequestMetric) String() string
type Response ¶
type Response []struct { Request RequestMetric `json:"request"` Value json.RawMessage `json:"value"` Error string `json:"error"` ErrorType string `json:"error_type"` Status uint `json:"status"` }
Response is a jolokia response with metrics
type SimpleValue ¶
type SimpleValue interface{}
SimpleValue holds a numeric value returned by jolokia