Monitoring Center Extension

Monitoring Center Extension

Extension Description

Responsible for monitoring service call counts and call times.

Extension Interfaces

  • org.apache.dubbo.monitor.MonitorFactory
  • org.apache.dubbo.monitor.Monitor

Extension Configuration

  1. <!-- Define the monitoring center -->
  2. <dubbo:monitor address="xxx://ip:port" />

Known Extensions

org.apache.dubbo.monitor.support.dubbo.DubboMonitorFactory

Extension Example

Maven project structure:

  1. src
  2. |-main
  3. |-java
  4. |-com
  5. |-xxx
  6. |-XxxMonitorFactory.java (implements the MonitorFactory interface)
  7. |-XxxMonitor.java (implements the Monitor interface)
  8. |-resources
  9. |-META-INF
  10. |-dubbo
  11. |-org.apache.dubbo.monitor.MonitorFactory (text file, content: xxx=com.xxx.XxxMonitorFactory)

XxxMonitorFactory.java:

  1. package com.xxx;
  2. import org.apache.dubbo.monitor.MonitorFactory;
  3. import org.apache.dubbo.monitor.Monitor;
  4. import org.apache.dubbo.common.URL;
  5. public class XxxMonitorFactory implements MonitorFactory {
  6. public Monitor getMonitor(URL url) {
  7. return new XxxMonitor(url);
  8. }
  9. }

XxxMonitor.java:

  1. package com.xxx;
  2. import org.apache.dubbo.monitor.Monitor;
  3. public class XxxMonitor implements Monitor {
  4. public void count(URL statistics) {
  5. // ...
  6. }
  7. }

META-INF/dubbo/org.apache.dubbo.monitor.MonitorFactory:

  1. xxx=com.xxx.XxxMonitorFactory

Feedback

Was this page helpful?

Yes No

Last modified September 30, 2024: Update & Translate Overview Docs (#3040) (d37ebceaea7)