Git Product home page Git Product logo

nacos-consul-adapter's Introduction

Nacos Consul Adapter (for Prometheus)

当使用Nacos作为注册中心时通过nacos-consul-adapter能够使prometheus自动发现Nacos中的服务

Restrictions

这个适配器只实现了prometheus使用consul_sd_config配置时需要的http接口,具体实现的接口如下:

  • /v1/agent/self 返回默认的datacenter
  • /v1/catalog/services 返回nacos中的服务列表
  • /v1/catalog/service/{service} 返回服务实例

Requirements

  • Java 1.8+
  • Spring Boot 2.1.x
  • Spring Cloud Greenwich

Prometheus

在prometheus配置文件中使用consul_sd_configs配置adapter地址

- job_name: 'nacos-prometheus'
  metrics_path: '/actuator/prometheus'
  consul_sd_configs:
  - server: 'localhost:8080'
    services: []

参考项目

eureka-consule-adapter

nacos-consul-adapter's People

Contributors

xuande avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nacos-consul-adapter's Issues

nacos指定namespace 和 group

spring:
application:
name: nacos-consul-adapter
cloud:
nacos:
config:
namespace: xxxxxxxxxxxxxxxxxxxxxxx
group: MY_GROUP
discovery:
namespace: xxxxxxxxxxxxxxxxxxxxxxx
group: MY_GROUP
server-addr: 192.168.1.230:8848


按上面的配置运行,需要升级依赖版本 2.1.2.RELEASE


		<dependency>
			<groupId>com.alibaba.cloud</groupId>
			<artifactId>spring-cloud-alibaba-dependencies</artifactId>
			<version>2.1.2.RELEASE</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>

very good project!

为什么只有本服务是启动的状态,获取到的其他的服务都是down的状态呢?而且单独访问已经可以导出metrics指标了

http://192.168.75.134:8084/actuator/prometheus | DOWN | instance="192.168.75.134:8084"job="nacos-prometheus" | 14.295s ago | 10.0s | Get "http://192.168.75.134:8084/actuator/prometheus": context deadline exceeded
http://192.168.75.134:8085/actuator/prometheus | DOWN | instance="192.168.75.134:8085"job="nacos-prometheus" | 22.710s ago | 10.1s | Get "http://192.168.75.134:8085/actuator/prometheus": context deadline exceeded
这个是启动的本服务:
http://10.1.2.160:8888/actuator/prometheus | UP | instance="10.1.2.160:8888"job="nacos-prometheus" | 4.484s ago | 7.197ms

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.