apache / hertzbeat

Apache HertzBeat(incubating) is a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities.
https://hertzbeat.apache.org/
Apache License 2.0
5.54k stars 961 forks source link

[BUG] mongodb srv connection support #2039

Open songxychn opened 4 months ago

songxychn commented 4 months ago

Is there an existing issue for this?

Current Behavior

i'm using mongodb atlas cloud database, version 7.0.8. connecting to it requires srv enabled. or i will get error message like below:

Timed out after 6000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=xxxxxx.xxxxxxx.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketException: xxxxxx.xxxxxx.mongodb.net}, caused by {java.net.UnknownHostException: xxxxxx.xxxxxx.mongodb.net}}]

Expected Behavior

whether srv is enabled could be configured by a option, like Navicat does.

Steps To Reproduce

  1. login in mongodb atlas
  2. get a free mongodb cloud database
  3. try to connect by hertzbeat

Environment

HertzBeat version(s): v1.5.0

Debug logs

No response

Anything else?

No response

zhangshenghang commented 4 months ago

The problem you mentioned does exist, but I found that the monitoring content of MongoDB Atlas is not very compatible with the ordinary MongoDB cluster monitoring indicators. You may need to configure a separate template for MongoDB Atlas. For example

I tried MongoDB version 7.0.9 and MongoDB Atlas version 7.0.x. They are incompatible.

If support for a MongoDB Atlas cluster is required, it can be assigned to me. @tomsun28