Open chrislee87 opened 8 years ago
JMX seems doesn't have interface for http protocal. So do you use a proxy to tranfer jmx interface to http interface or do you have other approaches? I can't directly get data from JMX use kafka-metrics-agent.
url := fmt.Sprintf("http://%s:%s@%s:%d/jmx/read/%s", jmxAdminUser, ctr.JMXAdminPassword, broker, kafkaJMXPort, metricsPath) metric, err := jmxMetrics(url)
func jmxMetrics(url string) (Metrics, error) { metrics := Metrics{} var mbeans map[string]interface{} err := Get(url, &mbeans) if err != nil { logrus.Error(err) return nil, fmt.Errorf("Internal server error") }
func Get(url string, obj interface{}) error { req, err := http.NewRequest("GET", url, nil) if err != nil { return err }
I run Kafka with https://jolokia.org/ to be able to reach JMX over HTTP.
JMX seems doesn't have interface for http protocal. So do you use a proxy to tranfer jmx interface to http interface or do you have other approaches? I can't directly get data from JMX use kafka-metrics-agent.