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

Add info on each HTTP client to HTTP stats #64561

Merged
merged 26 commits into from
Mar 17, 2021

Conversation

danhermann
Copy link
Contributor

@danhermann danhermann commented Nov 3, 2020

Elasticsearch currently provides only the count of HTTP clients currently holding an open connection and the number of HTTP connections that have been opened on the node. This is less than what is reported for transport clients and, as #61609 points out, additional information on connected HTTP clients would be very helpful in a number of troubleshooting and monitoring scenarios.

This change adds the following to the "http" section of node stats:

"http" : {
  "current_open" : 14,
  "total_opened" : 2735,
  "clients" : [
    {
      "agent" : "kibana",
      "local_address" : "/192.168.5.60:9200",
      "remote_address" : "/192.168.5.60:58156",
      "last_uri" : "/_nodes?filter_path=nodes.*.version%2Cnodes.*.http.publish_address%2Cnodes.*.ip",
      "opened_time_millis" : 1604420317590,
      "closed_time_millis" : -1,
      "last_request_time_millis" : 1604438560498,
      "request_count" : 4408,
      "request_size_bytes" : 261106
    },
    {
      "agent" : "curl/7.68.0",
      "local_address" : "/192.168.5.60:9200",
      "remote_address" : "/192.168.5.203:35834",
      "last_uri" : "/_nodes/stats/http?pretty",
      "opened_time_millis" : 1604438562302,
      "closed_time_millis" : 1604438562302,
      "last_request_time_millis" : 1604438562302,
      "request_count" : 1,
      "request_size_bytes" : 0
    }
    ...
  ]

Some notes about the fields above:

  • agent: This is pulled from the x-elastic-product-origin or User-Agent HTTP header if either is present. Note that it would be nice if Elastic products identified themselves with a user-friendly tag. The User-Agent header reports the Go client or the JS client for Beats and Kibana, respectively, which is better than nothing but not as nice as "filebeat" or "kibana", etc. The x-elastic-product-origin header reports a friendly "kibana" value for Kibana, but I don't believe that its purpose nor is it consistent across Elastic products.
  • closed_time_millis: This reports -1 for clients that are currently connected. As implemented, clients that disconnected within the last 5 minutes are still included to aid with tracking either clients such as curl that intentionally disconnect immediately or clients that are dropping connections for other reasons.
  • request_size_bytes: This tracks cumulative request size.

@danhermann danhermann added >enhancement :Data Management/Stats Statistics tracking and retrieval APIs labels Nov 3, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Stats)

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Nov 3, 2020
@danhermann danhermann marked this pull request as draft November 3, 2020 21:34
@danhermann
Copy link
Contributor Author

@elasticmachine update branch

@danhermann
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/2

@danhermann
Copy link
Contributor Author

@elasticmachine update branch

@danhermann
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/1

@danhermann
Copy link
Contributor Author

@elasticmachine update branch

@elasticmachine
Copy link
Collaborator

merge conflict between base and head

@danhermann
Copy link
Contributor Author

@elasticmachine update branch

@danhermann
Copy link
Contributor Author

@elasticmachine update branch

@danhermann
Copy link
Contributor Author

@elasticmachine update branch

@danhermann
Copy link
Contributor Author

@elasticmachine update branch

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for iterating Dan!

@danhermann
Copy link
Contributor Author

Thanks, @dakrone!

@danhermann danhermann merged commit 14cee55 into elastic:master Mar 17, 2021
@danhermann danhermann deleted the 61609_clients_api branch March 17, 2021 12:52
danhermann added a commit to danhermann/elasticsearch that referenced this pull request Mar 17, 2021
danhermann added a commit to danhermann/elasticsearch that referenced this pull request Mar 17, 2021
danhermann added a commit to danhermann/elasticsearch that referenced this pull request Mar 17, 2021
danhermann added a commit that referenced this pull request Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Stats Statistics tracking and retrieval APIs >enhancement Team:Data Management Meta label for data/management team v7.13.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants