mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 03:42:35 -06:00
208d324ab6
Currently OPA's decision logs do not include the trace and span identifier associated with a given request handled by the server. This information if available can be helpful to correlate logs and trace data. This change updates the decision log format to now include the trace and span identifier if present. Fixes: #5230 Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
43 lines
1.1 KiB
Go
43 lines
1.1 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
|
|
TraceID string
|
|
SpanID 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
|
|
}
|