Skip to content

场景化插件

Haotian Zhang edited this page Sep 9, 2022 · 4 revisions

概述

在项目的 spring-cloud-tencent-plugin-starters 模块中,包含了一些具体场景会使用到的插件,一般作为进阶使用进行引入。

插件列表

1. Push Gateway 上报插件(自 1.7.0 版本开始)

在一些场景下,开发者无法使用 Prometheus 的拉取模式上报北极星服务治理监控数据,而只能借助 Push Gateway 的方式进行监控指标上报。因此提供了 spring-cloud-tencent-pushgateway-plugin 插件对接 Push Gateway 。按照以下的方式操作即可简单接入 Push Gateway:

(1)引入依赖

pom.xml 中添加依赖。

<dependencies>
    ......

	<dependency>
		<groupId>com.tencent.cloud</groupId>
		<artifactId>spring-cloud-tencent-pushgateway-plugin</artifactId>
	</dependency>
</dependencies>

(2)添加 pushgateway 配置

spring:
  application:
    name: DiscoveryCalleeService
  cloud:
    polaris:
      address: grpc://183.47.111.80:8091
      namespace: default
      enabled: true
      stat:
        enabled: true
        pushgateway:
            enabled: true
            address: 127.0.0.1:9091
Clone this wiki locally