ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
# 50.8.2 示例: 导出到Open TSDB 如果提供一个`OpenTsdbGaugeWriter`类型的`@Bean`并注解`@ExportMetricWriter`,指标将导出到[Open TSDB ](http://opentsdb.net/)完成聚合。`OpenTsdbGaugeWriter`有一个`url`属性,你需要将它设置为Open TSDB的“/put”端点,比如`localhost:4242/api/put`。它还有个`namingStrategy`,你可以自定义或配置以使指标匹配服务器上你需要的数据结构。默认它只传递指标名作为Open TSDB指标名,添加`domain`标签(值为`org.springframework.metrics`)和`process`(值为命名策略的对象hash值)。因此,在运行应用并产生一些指标后,你可以在TSD UI查看这些指标(默认路径为`localhost:4242`)。 示例: ```text curl localhost:4242/api/query?start=1h-ago&m=max:counter.status.200.root [ { "metric": "counter.status.200.root", "tags": { "domain": "org.springframework.metrics", "process": "b968a76" }, "aggregateTags": [], "dps": { "1430492872": 2, "1430492875": 6 } } ] ```