You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "FoghostCn (via GitHub)" <gi...@apache.org> on 2023/09/06 11:26:26 UTC

[GitHub] [dubbo-go] FoghostCn commented on issue #2411: dubbo-go metric 设计文档

FoghostCn commented on issue #2411:
URL: https://github.com/apache/dubbo-go/issues/2411#issuecomment-1708160770

   ### 使用方式
   开启 metric 指标采集只需要在YAML配置文件中开启相应开关:
   ```yaml
   metrics:
     enable: true # default is false
     path: /custom-metrics-path # default is /metrics
     port: 9092 # default is 9090
   ```
   编码方式开启 metric:
   ```go
   rootConfig := config.NewRootConfigBuilder().
     SetProvider(config.NewProviderConfigBuilder().
       AddService("GreeterProvider", config.NewServiceConfigBuilder().Build()).Build()).
       SetMetric(config.NewMetricConfigBuilder().
         SetEnable(true). // 使用默认配置只需开启开关即可
         SetProrocol("prometheus").
         SetPath("/metric").
         SetPort(9092).
       Build()).
     Build()
   ```
   默认使用 Prometheus pull 模式暴露指标数据。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org