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

Add section on Timings to the audt daemon documentation

    XMLWordPrintable

Details

    • KV Sprint 2020-February

    Description

      Description

      There has been a request to ensure that if an audit event is to include elapsed time, they do that in the same format as Query

      Background

      An existing example of a Query audit event that uses elapsed time is

           {
                "description": "A N1QL SELECT statement was executed",
                "enabled": false,
                "filtering_permitted": true,
                "id": 28672,
                "mandatory_fields": {
                  "isAdHoc": true,
                  "metrics": {
                    "elapsedTime": "1.0s",
                    "errorCount": 0,
                    "executionTime": "0.75s",
                    "mutationCount": 0,
                    "resultCount": 1,
                    "resultSize": 18,
                    "sortCount": 1,
                    "warningCount": 1
                  },
                  "node": "",
                  "real_userid": {
                    "domain": "",
                    "user": ""
                  },
                  "remote": {
                    "ip": "",
                    "port": 1
                  },
                  "requestId": "",
                  "statement": "",
                  "status": "",
                  "timestamp": "",
                  "userAgent": ""
                },
                "name": "SELECT statement",
                "optional_fields": {
                  "clientContextId": "",
                  "namedArgs": {
                    "name1": "",
                    "name2": ""
                  },
                  "positionalArgs": [
                    ""
                  ]
                },
                "sync": false
              }
      

      For query's elapsed time is generated from the golang's time library: func (Duration) String func (d Duration) String() string
      String returns a string representing the duration in the form "72h3m0.5s". Leading zero units are omitted. As a special case, durations less than one second format use a smaller unit (milli-, micro-, or nanoseconds) to ensure that the leading digit is non-zero. The zero duration formats as 0s.

      Attachments

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

        Activity

          People

            owend Daniel Owen
            owend Daniel Owen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty