mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 03:42:35 -06:00
f1761ac77e
Today it is not possible to correlate the decision log with other types of logs (server, print, etc.) when the server log level is >= INFO. The log correlation could be helpful in troubleshooting. A solution is to add a common attribute in all logs to make the log correlation possible, so adding the req_id attribute on decision logs, when server log level is >= INFO, will make it possible. Fixes: #5006 * Add documentation about decision log req_id attribute The documentation purpose is to explain the relation with others logs, how it could be used, and when it is included on decision logs. Signed-off-by: Humberto Corrêa da Silva <humbertoc_silva@hotmail.com>
41 lines
1.0 KiB
Go
41 lines
1.0 KiB
Go
// Copyright 2017 The OPA Authors. All rights reserved.
|
|
// Use of this source code is governed by an Apache2
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package server
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/open-policy-agent/opa/ast"
|
|
"github.com/open-policy-agent/opa/metrics"
|
|
"github.com/open-policy-agent/opa/storage"
|
|
"github.com/open-policy-agent/opa/topdown"
|
|
)
|
|
|
|
// Info contains information describing a policy decision.
|
|
type Info struct {
|
|
Txn storage.Transaction
|
|
Revision string // Deprecated: Use `Bundles` instead
|
|
Bundles map[string]BundleInfo
|
|
DecisionID string
|
|
RemoteAddr string
|
|
Query string
|
|
Path string
|
|
Timestamp time.Time
|
|
Input *interface{}
|
|
InputAST ast.Value
|
|
Results *interface{}
|
|
MappedResults *interface{}
|
|
NDBuiltinCache *interface{}
|
|
Error error
|
|
Metrics metrics.Metrics
|
|
Trace []*topdown.Event
|
|
RequestID uint64
|
|
}
|
|
|
|
// BundleInfo contains information describing a bundle.
|
|
type BundleInfo struct {
|
|
Revision string
|
|
}
|