Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-39452

[BP to 6.6.0 of MB-39210]- Set "User-agent" in request header when making requests from indexer to ns_server

    XMLWordPrintable

    Details

    • Story Points:
      1

      Description

      Indexer has multiple components that query various ns_server endpoints. When such a query from indexer happens, ns_server would log it in ns_server.http_access_internal.log. Below is the format:

      127.0.0.1 - @index-cbauth [04/May/2020:05:39:18 -0700] "GET /pools/default/buckets/other-3/collections HTTP/1.1" 200 98 - "Go-http-client/1.1" 1

      The format of this message is:

      Node IP - User_of_the_request [Timestamp] "Request path" Response_status Size_of_response Referer User-agent Response_time

      Currently, the User_agent value mentions "Go-http-client/1.1" which does not convey any valuable information. Instead, each request from indexer can set the appropriate name of the client as User_agent i.e. RetrievePlanFromCluster can set User-agent as "RetrievePlanFromCluster" and it would get logged as below:

      127.0.0.1 - @index-cbauth [04/May/2020:05:39:18 -0700] "GET /pools/default/buckets/other-3/collections HTTP/1.1" 200 98 - "RetrievePlanFromCluster" 1

      This would help us to associate a request with it's client facilitating easy debugging

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

            Hide
            mihir.kamdar Mihir Kamdar added a comment -

            Hi Jeelan Poola, I am fine taking this.

            Show
            mihir.kamdar Mihir Kamdar added a comment - Hi Jeelan Poola , I am fine taking this.
            Hide
            build-team Couchbase Build Team added a comment -

            Build couchbase-server-6.6.0-7681 contains indexing commit 2d9777f with commit message:
            MB-39452 Set UserAgent in request headers to ns_server

            Show
            build-team Couchbase Build Team added a comment - Build couchbase-server-6.6.0-7681 contains indexing commit 2d9777f with commit message: MB-39452 Set UserAgent in request headers to ns_server
            Hide
            hemant.rajput Hemant Rajput added a comment -

            Can you provide steps to verify?

            Show
            hemant.rajput Hemant Rajput added a comment - Can you provide steps to verify?
            Hide
            varun.velamuri Varun Velamuri added a comment -

            Hemant Rajput, Most of the requests from indexer to ns_server now carry the user-agent in the requests. This means that instead of "Go-http-client/1.1", we should see something like "indexer-<module_name>-Go-http-client/1.1" (E.g., "indexer-RetrievePlanFromCluster-Go-http-client/1.1") in http_access_internal.log

            For this bug, I think it is good to verify mixed mode support once

            Show
            varun.velamuri Varun Velamuri added a comment - Hemant Rajput , Most of the requests from indexer to ns_server now carry the user-agent in the requests. This means that instead of "Go-http-client/1.1", we should see something like "indexer-<module_name>-Go-http-client/1.1" (E.g., "indexer-RetrievePlanFromCluster-Go-http-client/1.1") in http_access_internal.log For this bug, I think it is good to verify mixed mode support once
            Hide
            hemant.rajput Hemant Rajput added a comment -

            Verified with build 6.6.0-7816 in both mixed (6.0.3) and non-mixed mode. Can see the logs have Go-http-client/1.1-indexer-<modulename> formats. 

            Above format is confirmed by Varun Velamuri, and this is the correct format.

             

            Closing the ticket.

            Show
            hemant.rajput Hemant Rajput added a comment - Verified with build 6.6.0-7816 in both mixed (6.0.3) and non-mixed mode. Can see the logs have Go-http-client/1.1-indexer-<modulename> formats.  Above format is confirmed by Varun Velamuri , and this is the correct format.   Closing the ticket.

              People

              Assignee:
              hemant.rajput Hemant Rajput
              Reporter:
              varun.velamuri Varun Velamuri
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes

                    PagerDuty