fix: rename audit log docs and datastructure

master
Harshavardhana 4 years ago
parent 00cff1aac5
commit 6717295e18
  1. 8
      cmd/erasure-sets.go
  2. 4
      cmd/logger/message/audit/entry.go
  3. 23
      docs/logging/README.md

@ -455,9 +455,9 @@ func (s *erasureSets) cleanupStaleUploads(ctx context.Context, cleanupInterval,
const objectErasureMapKey = "objectErasureMap" const objectErasureMapKey = "objectErasureMap"
type auditObjectOp struct { type auditObjectOp struct {
Pool int `json:"pool"` Pool int `json:"poolId"`
Set int `json:"set"` Set int `json:"setId"`
BackendServers []string `json:"backendServers"` Disks []string `json:"disks"`
} }
func auditObjectErasureSet(ctx context.Context, object string, set *erasureObjects, poolNum int) { func auditObjectErasureSet(ctx context.Context, object string, set *erasureObjects, poolNum int) {
@ -470,7 +470,7 @@ func auditObjectErasureSet(ctx context.Context, object string, set *erasureObjec
op := auditObjectOp{ op := auditObjectOp{
Pool: poolNum + 1, Pool: poolNum + 1,
Set: set.setNumber + 1, Set: set.setNumber + 1,
BackendServers: set.getEndpoints(), Disks: set.getEndpoints(),
} }
var objectErasureSetTag map[string]auditObjectOp var objectErasureSetTag map[string]auditObjectOp

@ -68,7 +68,9 @@ func ToEntry(w http.ResponseWriter, r *http.Request, reqClaims map[string]interf
for k, v := range wh { for k, v := range wh {
respHeader[k] = strings.Join(v, ",") respHeader[k] = strings.Join(v, ",")
} }
respHeader[xhttp.ETag] = strings.Trim(respHeader[xhttp.ETag], `"`) if etag := respHeader[xhttp.ETag]; etag != "" {
respHeader[xhttp.ETag] = strings.Trim(etag, `"`)
}
entry := Entry{ entry := Entry{
Version: Version, Version: Version,

@ -60,10 +60,10 @@ Setting this environment variable automatically enables audit logging to the HTT
NOTE: NOTE:
- `timeToFirstByte` and `timeToResponse` will be expressed in Nanoseconds. - `timeToFirstByte` and `timeToResponse` will be expressed in Nanoseconds.
- In the case of the erasure setup `tags.objectErasureMap` provides - Additionally in the case of the erasure coded setup `tags.objectErasureMap` provides per object details about
- Pool number - Pool number the object operation was performed on.
- Set number - Set number the object operation was performed on.
- The list of disks belonging to the set - The list of disks participating in this operation belong to the set.
```json ```json
{ {
@ -103,13 +103,14 @@ NOTE:
}, },
"tags": { "tags": {
"objectErasureMap": { "objectErasureMap": {
"pool": 1, "object": {
"set": 10, "poolId": 1,
"path/to/object": [ "setId": 10,
"http://minio.example.com/mnt/zone1/disk1", "disks": [
"http://minio.example.com/mnt/zone1/disk2", "http://server01/mnt/pool1/disk01",
"http://minio.example.com/mnt/zone1/disk3", "http://server02/mnt/pool1/disk02",
"http://minio.example.com/mnt/zone1/disk4" "http://server03/mnt/pool1/disk03",
"http://server04/mnt/pool1/disk04"
] ]
} }
} }

Loading…
Cancel
Save