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

TT-496 Bugfix/uptime checks nodes #3321

Merged
merged 9 commits into from
Sep 24, 2020

Conversation

tbuchaillot
Copy link
Contributor

@tbuchaillot tbuchaillot commented Sep 21, 2020

Description

Added 2 configurations options for uptime tests.
disable_management_poller - bool - Disables host checker manager in that gw.
poller_group - string - Adds a postfix to the Poller Cache key. In that way, we can have different pollers for each group.

An example of a config with poller_group:

 "uptime_tests": {
        "disable": false,
        "poller_group":"external",
        "config": {
            "failure_trigger_sample_size": 1,
            "time_wait": 2,
            "checker_pool_size": 50,
            "enable_uptime_analytics": true
        }
    },

An example of a config with disable_management_poll:

 "uptime_tests": {
        "disable_management_polle":true
    },

Related Issue

https://tyktech.atlassian.net/browse/TT-496

Motivation and Context

On sharded gateway environments, each shard / node should have their own Poller / Host checker to do the uptimetest of their APIs. For more context, please check https://tyktech.atlassian.net/browse/TT-496

How This Has Been Tested

Tested with:
2 GWs: poller_group:"a" , db_app_conf_options.node_is_segmented:true and db_app_conf_options.tags:["test"]
1 GWs: poller_group:"b" , db_app_conf_options.node_is_segmented:true and db_app_conf_options.tags:["test-2"]
1 GW : "disable_management_poller":true
1 Pump running with uptime tests configured.

1 API with tag "test" and uptime tests on.
1 API with tag "test-2" and uptime tests on.

In Redis we're going to have 2 Poller:
image

and in Mongo we're going to have the uptime records for boths APIs.
image

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring or add test (improvements in base code or adds test coverage to functionality)

Checklist

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side). If pulling from your own
    fork, don't request your master!
  • Make sure you are making a pull request against the master branch (left side). Also, you should start
    your branch off our latest master.
  • My change requires a change to the documentation.
    • If you've changed APIs, describe what needs to be updated in the documentation.
    • If new config option added, ensure that it can be set via ENV variable
  • I have updated the documentation accordingly.
  • Modules and vendor dependencies have been updated; run go mod tidy && go mod vendor
  • When updating library version must provide reason/explanation for this update.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • Check your code additions will not fail linting checks:
    • go fmt -s
    • go vet

@tbuchaillot tbuchaillot changed the title Bugfix/uptime checks nodes TT-496 Bugfix/uptime checks nodes Sep 22, 2020
Copy link
Contributor

@matiasinsaurralde matiasinsaurralde left a comment

Choose a reason for hiding this comment

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

LGTM

gateway/server.go Outdated Show resolved Hide resolved
Copy link
Member

@joshblakeley joshblakeley left a comment

Choose a reason for hiding this comment

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

Thanks @tbuchaillot this looks good to me.

@matiasinsaurralde matiasinsaurralde merged commit eaf90a7 into release-2.9 Sep 24, 2020
@matiasinsaurralde matiasinsaurralde deleted the bugfix/uptime-checks-nodes branch September 24, 2020 05:04
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.

3 participants