Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support MySQL/Redis/MongoDB/PostgreSQL/Zookeeper Native Client to check the data #171

Merged
merged 14 commits into from
Jul 19, 2022

Conversation

haoel
Copy link
Contributor

@haoel haoel commented Jul 17, 2022

Redis

client:
  - name: Redis Native Client (local)
    driver: "redis"  # driver is redis
    host: "localhost:6379"  # server and port
    data:         # Optional
      key: val    # Check that `key` exists and its value is `val`

MySQL

client
   - name: MySQL Native Client (local)
      driver: "mysql"
      host: "localhost:3306"
      data: # Optional, check the specific column value in the table
        #  Usage: "database:table:column:primary_key:value" : "expected_value"
        #         transfer to : "SELECT column FROM database.table WHERE primary_key = value"
        #         the `value` for `primary_key` must be int
        "test:product:name:id:1" : "EaseProbe" # select name from test.product where id = 1
        "test:employee:age:id:2" : 45          # select age from test.employee where id = 2

MongoDB

client:
  - name: MongoDB Native Client (local)
    driver: "mongo"
    host: "localhost:27017"
    data: # Optional, find the specific value in the table
      #  Usage: "database:collection" : "{JSON}"
      "test:employee" : '{"name":"Hao Chen"}' # find the employee with name "Hao Chen"
      "test:product" : '{"name":"EaseProbe"}' # find the product with name "EaseProbe"

PostgreSQL

client:
  - name: PostgreSQL Native Client (local)
    driver: "postgres"
    host: "localhost:5432"
    data: # Optional, check the specific column value in the table
      #  Usage: "database:table:column:primary_key:value" : "expected_value"
      #         transfer to : "SELECT column FROM table WHERE primary_key = value"
      #         the `value` for `primary_key` must be int
      "test:product:name:id:1" : "EaseProbe" # select name from product where id = 1
      "test:employee:age:id:2" : 45          # select age from employee where id = 2

Zookeeper

client:
  - name: Zookeeper Native Client (local)
    driver: "zookeeper"
    host: "localhost:2181"
    data: # Optional, check the specific value in the path
      "/path/to/key": "value" # Check that the value of the `/path/to/key` is "value"

@haoel haoel requested review from proditis and zhao-kun July 17, 2022 06:58
@codecov-commenter
Copy link

codecov-commenter commented Jul 17, 2022

Codecov Report

Merging #171 (dbf33b6) into main (8a4de80) will increase coverage by 0.46%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
+ Coverage   93.43%   93.89%   +0.46%     
==========================================
  Files          46       46              
  Lines        3411     3636     +225     
==========================================
+ Hits         3187     3414     +227     
+ Misses        157      155       -2     
  Partials       67       67              
Impacted Files Coverage Δ
probe/client/client.go 100.00% <100.00%> (+5.40%) ⬆️
probe/client/conf/conf.go 86.95% <100.00%> (+4.60%) ⬆️
probe/client/kafka/kafka.go 100.00% <100.00%> (ø)
probe/client/memcache/memcache.go 100.00% <100.00%> (ø)
probe/client/mongo/mongo.go 100.00% <100.00%> (ø)
probe/client/mysql/mysql.go 100.00% <100.00%> (ø)
probe/client/postgres/postgres.go 100.00% <100.00%> (ø)
probe/client/redis/redis.go 100.00% <100.00%> (ø)
probe/client/zookeeper/zookeeper.go 100.00% <100.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a4de80...dbf33b6. Read the comment docs.

@haoel haoel changed the title feat: Support MySQL/Redis/MongoDB/PostgresQL Native Client to check the data feat: Support MySQL/Redis/MongoDB/PostgreSQL/Zookeeper Native Client to check the data Jul 18, 2022
@zhao-kun
Copy link
Contributor

Question: Do we need to support probing all nodes of a Redis cluster with one configuration?

probe/client/mongo/mongo.go Outdated Show resolved Hide resolved
probe/client/mysql/mysql.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@proditis proditis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM not tested yet

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Co-authored-by: Pantelis Roditis <[email protected]>
@haoel
Copy link
Contributor Author

haoel commented Jul 18, 2022

Question: Do we need to support probing all nodes of a Redis cluster with one configuration?

At this moment, we don't have a plan to do this, we only can configure a cluster by individual configuration.

To introduce the cluster concept is good for configuration, but we have to separate the cluster into individual prober, and name every prober a unique name, and people might need a cluster-wide healthy status or SLA, this would bring complexity to the current design.

So, I'd like to be a businessman here, I want to see how many benefits we can get from this requirement. ;-)

@haoel haoel merged commit b4d8676 into megaease:main Jul 19, 2022
@muicoder
Copy link
Contributor

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants