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

Use Elasticsearch cluster health for check instead of ping #290

Closed
wants to merge 7 commits into from

Commits on Oct 2, 2019

  1. Use Elasticsearch cluster health for check instead of ping

    Ping will only allow to return healthy or unhealthy statuses. By using
    Elasticsearch Cluster Health API [1] we can also return degraded if
    the cluster is in yellow state.
    
    Note that I needed to convert the cluster status to a string instead
    of using Elasticsearch.Net.Health enum, as otherwise we would need to
    add a reference to the Elasticsearch.Net NuGet package.
    
    1: https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html
    inkel committed Oct 2, 2019
    Configuration menu
    Copy the full SHA
    c2e6bea View commit details
    Browse the repository at this point in the history
  2. Add ElasticsearchOptions.UseClusterHealth option

    By default the option is false, meaning it will use ping as it was
    previously doing. If the user wants advanced health check they can
    call this method which will instruct ElasticsearchHealthCheck to use
    the Cluster Health API instead. See parent commit for more information.
    inkel committed Oct 2, 2019
    Configuration menu
    Copy the full SHA
    faea6ce View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2019

  1. Refactor switch statement

    inkel committed Oct 7, 2019
    Configuration menu
    Copy the full SHA
    c63b643 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2019

  1. Configuration menu
    Copy the full SHA
    ae65e9a View commit details
    Browse the repository at this point in the history
  2. Add functional tests for Elasticsearch cluster api checks

    These new tests don't need a running Elasticsearch instance but rather
    create a mock HTTP server that will send back responses in the same
    format as Elasticsearch Cluster Health API does.
    inkel committed Oct 9, 2019
    Configuration menu
    Copy the full SHA
    9220378 View commit details
    Browse the repository at this point in the history
  3. Remove Task.Delay in tests

    This was for debugging purposes.
    inkel committed Oct 9, 2019
    Configuration menu
    Copy the full SHA
    7033e15 View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2019

  1. Apply suggestion

    Do not unnecessarily assigned a default value that's equal to the zero value of a boolean.
    
    Co-Authored-By: Ivan Maximov <sungam3r@yandex.ru>
    inkel and sungam3r committed Nov 26, 2019
    Configuration menu
    Copy the full SHA
    b4fd01c View commit details
    Browse the repository at this point in the history