Commit Graph

275 Commits

Author SHA1 Message Date
Ashutosh Narkar 414df4e909 Include OPA min compat version in telemetry report
This commit extends the telemetry report to include the
minimum compatible version of policies loaded into OPA.
This information can be helpful to get visibility into
era of Rego being adopted in the wild.

Fixes: #6361

Co-authored-by: Stephan Renatus <stephan@styra.com>
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2023-12-18 11:06:03 -08:00
Colin J Lacy 0b9bbc5011 plugins/rest: masks X-AMZ-SECURITY-TOKEN header in decision logs (#6423)
Decision logs had previously been configured to hide the value of the
Authorization header, as that is considered sensitive information.
However, there are cases when additional headers are provided that
contain sensitive information, such as the X-AMZ-SECURITY-TOKEN header.
This PR creates an internal map of headers that should be masked, which
can be expanded if additional headers are required. It then loops over
the headers in a request, and performs a lookup on the internal map
to see if any of them match those that should be masked. If so, it
replaces their values with "REDACTED". An existing test was added to
check both the header keys that should be masked, as well as a key
that should not.

Additional work, out of scope for this PR, would be to open a config
setting that would allow users to pass in a list of headers that should
be masked.

Fixes: #5848

Signed-off-by: Colin Lacy <colinjlacy@gmail.com>
2023-11-29 17:26:25 +01:00
Charlie Egan f102042ea8 discovery: Make status updates non blocking (#6345)
Fixes #6343

A status endpoint that times out, will no longer delay boots.

Signed-off-by: Charlie Egan <charlie@styra.com>
2023-11-06 16:19:09 -06:00
Asad Khan 98031ac004 adding comments on test bahaviour
Signed-off-by: Asad Khan <asadullah.khan@deliveryhero.com>
2023-10-16 13:59:09 -07:00
Asad Khan 86721eaef9 fix for plugin state reconciliation
Signed-off-by: Asad Khan <asadullah.khan@deliveryhero.com>
2023-10-16 13:59:09 -07:00
Asad Khan 29d24a495a adding a failing test for plugin.Reconfigure with bundle download Not Modified
Signed-off-by: Asad Khan <asadullah.khan@deliveryhero.com>
2023-10-16 13:59:09 -07:00
aarnautu 38c997eef4 This change adds support to configurable prometheus buckets
http_request_duration has fixed, hardcoded number of buckets with no possibility to tweak them
For cases when the most of the latencies are above 1ms, with only 4 available buckets there's no good insight on OPA's performance.

This implementation:
- adds the possibility for the buckets to be configurable in ```server.metrics.prom.http_request_duration_seconds.buckets``` key
- it's not a breaking change, if the buckets are not present in the configuration, the metric is configured with the existing values as a fallback

Signed-off-by: aarnautu <aarnautu@adobe.com>
2023-10-06 13:27:46 -07:00
Ashutosh Narkar 919b290ef7 plugins: Surface AWS authentication error details
OPA supports multiple AWS authentication methods. Currently
on an unsuccessful authentication, OPA logs the error at the debug
level. It would be helpful especially in a prod env to surface these
errors via the Status API to assist with debugging issues. This change
attempts to achieve that.

Fixes: #6232

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2023-09-25 10:54:55 -07:00
Ashutosh Narkar 0e69dbba20 Extend type checking for authz policies
The schema of the input document for the authorization
policy is known to OPA. This feature leverages that
to perform automatic type checking on the authorization policy.
The checks happen on policies provided to OPA on start-up and
also those provided via bundles. This check is enabled by default
and can be disabled using the `--skip-known-schema-check` flag
on `opa run`. This feature will help catch errors such as
typos, mismatch types etc. in these policies and provide precise
feedback to the policy author.

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2023-09-11 15:34:10 -07:00
Manuel Rüger 9cab6c95cf chore: Replace ghodss/yaml with sigs.k8s.io/yaml (#6195)
This is a fork that is maintained by the kubernetes community.

https://github.com/kubernetes-sigs/yaml

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-08-30 15:08:36 +02:00
Stephan Renatus f8e1e4bf2d golang: 1.20.7 -> 1.21 (#6189)
https://tip.golang.org/doc/go1.21

This required some test updates:

* topdown/tokens_test: adjust for go1.21

   What was correct for 1.20 is correct for 1.21, so I've flipped the exception logic.

* plugins/rest/TestClientCert: adapt cert-related error string

* internal/prometheus/TestJSONSerialization: add new metrics

   There are new metrics!

Signed-off-by: Stephan Renatus <stephan@styra.com>
2023-08-29 15:26:09 +02:00
guoguangwu 8fa5b02b53 chore: pkg imported more than once
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-07-18 07:59:09 -07:00
Benjamin Nørgaard f0b351d683 plugins/discovery: ensure discovery doesn't erase its own config
When the discovery plugin receives a a discovery bundle which omits the
discovery configuration, it deletes its own configuration from the
manager. In turn this means that `GET /v1/config` doesn't show the
configuration of the discovery plugin.

This change ensures that the plugin will never overwrite the discovery
configuration on the manager.

Signed-off-by: Benjamin Nørgaard <mail@blacksails.dev>
2023-07-06 10:34:00 -07:00
Prasanth Ullattil db2f8ae7bb Add AWS KMS support for OAuth2 Client Credentials JWT authentication
This implementaion adds new configuration properties to "oauth2"
aws_kms: AWS KMS key details
aws_signing: Infomation for signing AWS requestion, similar to s3_signing

References:
1) https://github.com/go-jose/go-jose/blob/v3/asymmetric.go#L501
2) https://github.com/codelittinc/gobitauth/blob/master/sign.go#L101

Signed-off-by: Prasanth Ullattil <prasanth.ullattil@dnb.no>
2023-07-03 11:01:15 -07:00
Stephan Renatus a9cff5b05e build: add errors.Join workaround for go <1.20
Signed-off-by: Stephan Renatus <stephan@styra.com>
2023-06-29 10:18:41 +02:00
Stephan Renatus c9042db15f extensibility: add hooks (plugins, discovery, sdk)
This adds a lightweight extensibility mechanism to OPA: hooks. Loosely
modelled on what franz-go supports (see refs below).

We're starting with a configuration hook. It allows us to inspect or
alter the configuration of OPA after...

1. the config is read and parsed: OnConfig
2. a discovery bundle is processed: OnConfigDiscovery

References:
- franz-go: https://pkg.go.dev/github.com/twmb/franz-go/pkg/kgo#Hook

To follow:
- more hooks where they are useful
- runtime support for hooks, wiring them into the proper other places

Signed-off-by: Stephan Renatus <stephan@styra.com>
2023-06-29 10:18:41 +02:00
Benjamin Nørgaard caa24f0c4e plugins/discovery: Fix discovery erasing persistence_directory config
Before this change, if a discovery bundle didn't contain configuration
for `persistence_directory`, this would be deleted from the manager's
configuration. When enabling persistence of the discovery bundle this
doesn't make much sense, as the first discovery bundle would erase the
persistence settings.

This change ensures that discovery never erases `persistence_directory`.

Signed-off-by: Benjamin Nørgaard <mail@blacksails.dev>
2023-06-28 16:35:16 -07:00
Jacob Gosch Søndergaard 7c39ef5e87 plugins/discovery: fix persistance of discovery bundle
Currently discovery bundle tar balls are empty.
Add missing option `WithBundlePersistence` to the discovery plugin's downloader, so that the download raw buffer gets populated

Signed-off-by: Jacob Gosch Søndergaard <jgs@bankdata.dk>
2023-06-26 12:35:17 -07:00
Johan Fylling 304be03e98 cmd: Making test watch-mode tests more robust (#6019)
* Waiting for output buffer to contain expected data rather than making exact matches on the entire content.
* Not aborting watcher on encountered errors

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2023-06-19 10:51:28 +02:00
Stephan Renatus 8243359538 go: misc version-related updates (#6023)
- remove plugins/status workaround for go1.17
- remove build tags requring 1.18 -- nothing older than that is going to be used

Signed-off-by: Stephan Renatus <stephan@styra.com>
2023-06-16 19:51:52 +02:00
Magnus Jungsbluth 22619d26c0 Add tracing to bundle/discovery download
Signed-off-by: Magnus Jungsbluth <magnus@jungsbluth.de>
2023-06-06 09:36:40 -07:00
Ashutosh Narkar ab817b215c plugins/logs: Make a local copy of plugin's status
Previously while passing the plugins's status to the
Status API, the decision log plugin held the lock
while a status upload was in process. So if a
status upload took a while or the status plugin
was blocked as it processed some other update, this would
block policy evaluation requests received by the OPA server
and increase client latency. This is because since the decision
log plugin held the lock, new log events could be inserted
into its buffer only after the lock was released.

This change makes a copy of the decision log status so that
the lock is not held during a status update.

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2023-06-05 09:04:46 -07:00
Johan Fylling 691173a347 status: Registering Prometheus Collectors on Status-plugin reconfigure (#5928)
* status: Registering Prometheus Collectors on Status-plugin reconfigure

if `Prometheus` was enabled on active config change; and unregistering collectors if disabled.

Fixes: #5918
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2023-05-19 10:47:32 +02:00
Johan Fylling 77475dc2ab rest: Make Amazon AWS STS domain configurable for AWS rest plugin
Fixes: #5915

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2023-05-17 11:41:53 -07:00
Javad f44aa7eb51 Add OPA environment information Gauge to Prometheus metrics
Closes issue #5852
Provides version of OPA in a Prometheus gauge for observability

Signed-off-by: Javad <j.moghisi@gmail.com>
2023-05-02 23:15:57 -07:00
cui fliter 5bd64ff2bc fix some comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-04-28 10:17:48 -07:00
DerGut b626a2c93b Use existing auth plugins with OCIDownloader
This change addresses solutions 2) and 3) of the related issue #5553.
It mainly starts using the (now exposed) `Config.AuthPlugin()` function
of the `rest` package in the `download.OCIDownloader`. This allows it
to use any `HTTPAuthPlugin` that is defined in the `Config.Credentials`
section and makes it much more consistent with behavior of the
`download.Downloader` and potential other uses of the rest package.

Fixes #5553

Signed-off-by: DerGut <jannik.steinmann@gmx.de>
2023-04-25 17:15:46 -07:00
Magnus Jungsbluth 04351d288b Allow adding labels via discovery
Signed-off-by: Magnus Jungsbluth <magnus@jungsbluth.de>
2023-04-17 14:17:39 -07:00
Ashutosh Narkar 208d324ab6 Include trace and span identifier in decision logs
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>
2023-04-05 23:25:05 -07:00
Ashutosh Narkar c858397ffc plugins: Surface more decision log errors via status API
Previously in #5732 we updated the decision log plugin to
surface errors via the Status API. However in that change
certain events like encoder errors and log drops due to
buffer size limits had no metrics associated with them.
This change adds more metrics for these events so that they
can be surfaced via the Status API.

Fixes: #5637

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2023-03-30 09:08:53 -07:00
Ashutosh Narkar 9163bbd209 plugins/rest: Include truncated HTTP response in logs
This commit updates the client debug log to include
the full HTTP response in case of non-200 status codes.
Recording the response in the logs can help to provide
more information to debug error scenarios.

Fixes: #2961

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2023-03-22 00:33:54 -07:00
Stephan Renatus 839ea94f12 mask: don't rely on JSON roundtrip to convert structs (#5770)
Reading the code, I couldn't bear the use of a JSON roundtrip to convert
from one kind of struct to another.

$ benchstat main.out pr.out
goos: darwin
goarch: amd64
pkg: github.com/open-policy-agent/opa/plugins/logs
cpu: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
                                  │  main.out   │               pr.out                │
                                  │   sec/op    │   sec/op     vs base                │
MaskingNop-16                       4.779µ ± 2%   4.892µ ± 1%   +2.38% (p=0.009 n=10)
MaskingRuleCountsNop/1Rules-16      4.859µ ± 3%   4.868µ ± 1%        ~ (p=0.754 n=10)
MaskingRuleCountsNop/10Rules-16     5.047µ ± 3%   4.872µ ± 0%   -3.47% (p=0.000 n=10)
MaskingRuleCountsNop/100Rules-16    5.089µ ± 4%   4.846µ ± 1%   -4.78% (p=0.000 n=10)
MaskingRuleCountsNop/1000Rules-16   4.894µ ± 4%   4.905µ ± 3%        ~ (p=0.684 n=10)
MaskingErase-16                     14.66µ ± 2%   11.77µ ± 3%  -19.72% (p=0.000 n=10)
geomean                             5.914µ        5.648µ        -4.50%

                                  │   main.out   │                 pr.out                 │
                                  │     B/op     │     B/op      vs base                  │
MaskingNop-16                       3.136Ki ± 0%   3.136Ki ± 0%        ~ (p=1.000 n=10)
MaskingRuleCountsNop/1Rules-16      3.136Ki ± 0%   3.136Ki ± 0%        ~ (p=1.000 n=10) ¹
MaskingRuleCountsNop/10Rules-16     3.136Ki ± 0%   3.136Ki ± 0%        ~ (p=1.000 n=10) ¹
MaskingRuleCountsNop/100Rules-16    3.136Ki ± 0%   3.136Ki ± 0%        ~ (p=1.000 n=10) ¹
MaskingRuleCountsNop/1000Rules-16   3.136Ki ± 0%   3.136Ki ± 0%        ~ (p=1.000 n=10) ¹
MaskingErase-16                     8.328Ki ± 0%   7.281Ki ± 0%  -12.57% (p=0.000 n=10)
geomean                             3.690Ki        3.608Ki        -2.21%
¹ all samples are equal

                                  │  main.out  │               pr.out                │
                                  │ allocs/op  │ allocs/op   vs base                 │
MaskingNop-16                       65.00 ± 0%   65.00 ± 0%       ~ (p=1.000 n=10) ¹
MaskingRuleCountsNop/1Rules-16      65.00 ± 0%   65.00 ± 0%       ~ (p=1.000 n=10) ¹
MaskingRuleCountsNop/10Rules-16     65.00 ± 0%   65.00 ± 0%       ~ (p=1.000 n=10) ¹
MaskingRuleCountsNop/100Rules-16    65.00 ± 0%   65.00 ± 0%       ~ (p=1.000 n=10) ¹
MaskingRuleCountsNop/1000Rules-16   65.00 ± 0%   65.00 ± 0%       ~ (p=1.000 n=10) ¹
MaskingErase-16                     149.0 ± 0%   138.0 ± 0%  -7.38% (p=0.000 n=10)
geomean                             74.64        73.69       -1.27%
¹ all samples are equal

Signed-off-by: Stephan Renatus <stephan@styra.com>
2023-03-18 07:55:40 +01:00
Stephan Renatus c6a341baa5 plugins/logs: don't convert EventV1 to ast.Value twice (#5761)
The existing benchmarks on the masking can't be compared with before/after:
it's unfair, we're no longer converting the event to ast.Value inside that
method.

But in the overall query processing, this change should be beneficial: we
avoid converting every event _twice_.

Signed-off-by: Stephan Renatus <stephan@styra.com>
2023-03-17 10:31:43 +01:00
AdrianArnautu 9e97f98d12 This change allows the HTTP clients to consume and send gzip compressed response and request body. (#5696)
It is available for the following REST API endpoints:
- GET & POST HTTP methods on /v0/data & /v1/data endpoints
- POST HTTP method on /v1/compile endpoint

HTTP clients can optionally:
- send 'Accept-Encoding: gzip' header and expect a gzip compressed body and a Content-Encoding: gzip response header. The server will send the content encoded as gzip only after a threshold defined by server.encoding.gzip.min_length (default value is 1024). If the size is below the threshold, the body is not compressed
- send 'Content-Encoding: gzip' header and a gzip compressed body and expect the server to correctly interpret the request

Fixes #5310

Signed-off-by: aarnautu <aarnautu@adobe.com>
2023-03-09 09:38:39 +01:00
Ashutosh Narkar c4efb263ea plugins: Surface decision log errors via status API
Currently errors encountered during decision log uploads
are logged. This change now includes these errors as
part of status updates  which can be useful for the control plane
to determine if OPA is having any issues while processing, uploading logs etc.

Fixes: #5637

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2023-03-08 00:12:42 -08:00
Anders Eknert ff450934d1 decision logging: remove unused inter-query cache setup (#5731)
Since a cache was created per request, this did not work as intended.
As it's unlikely that http.send is used in decision log drop/masking
decisions, it should be alright to leave this out until this is
requested, if ever.

Signed-off-by: Anders Eknert <anders@styra.com>
2023-03-07 07:46:46 +01:00
Charlie Egan d43a103b59 [discovery] Catch missing discovery bundle name
I ran into this error:

```
$ opa run -s --config-file=config.yaml
{"addrs":[":8181"],"diagnostic-addrs":[],"level":"info","msg":"Initializing server.","time":"2023-03-01T16:25:09Z"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x101614e50]

goroutine 1 [running]:
github.com/open-policy-agent/opa/plugins/discovery.(*Discovery).loadBundleFromDisk(...)
        /Users/charlieegan3/Code/opa/plugins/discovery/discovery.go:252
```

When using this config:

```
services:
  example:
    url: http://localhost:8080

discovery:
  service: example
  resource: /configuration/example/discovery.tar.gz
  persist: true
```

To address this I have wrapped the problematic uses of the deprecated
Name field in a function which provides a default. I had hoped to do
more, but the use of these deprecated fields is prevalent in the package
tests and I thought I'd share this fix as is before spending longer on
it.

Signed-off-by: Charlie Egan <charlie@styra.com>
2023-03-01 11:24:47 -08:00
Stephan Renatus c9ec05d3fe bump: go 1.19.5 -> 1.20.1
This PR bumps go to 1.20.1 (https://go.dev/doc/go1.20) which
addresses the following vulnerabilities:
https://pkg.go.dev/vuln/GO-2023-1571
https://pkg.go.dev/vuln/GO-2023-1570
https://pkg.go.dev/vuln/GO-2023-1568

As part of the migration, general Golang
stdlib deprecations and test failures were addressed as well.
Some of those changes are:

* Bump golangci-lint for support with go1.20
* Migrate rand.Seed() calls to the newer rand.New(rand.NewSource(seed))

Co-authored-by: Stephan Renatus <stephan@styra.com>
Co-authored-by: Philip Conrad <philipaconrad@gmail.com>

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2023-02-21 13:51:23 -08:00
Ashutosh Narkar 16300529a2 plugins/discovery: Support to persist and load discovery bundle from disk
This commit adds support to persist and load discovery bundle from disk.
Only the discovery bundle itself is persisted and not the configuration produced
by the discovery bundle. A new field is introduced in OPA's discovery
configuration that can be optionally set to enable OPA to write and
read the discovery bundle from disk. This feature would enable OPA to evaluate
the discovery bundle in scenarios where it is unable to communicate with the
bundle server on start-up.

Fixes #2886

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2023-02-06 13:43:02 -08:00
Iceber Gu 2131da3d9c remove github.com/pkg/errors
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2023-01-11 10:30:48 -08:00
Charlie Egan 8bb23ba156 [rego] Check store modules before skipping parsing (#5520)
* [rego] Check store modules before skipping parsing

Fixes https://github.com/open-policy-agent/opa/issues/5511

This change will cause the operation to be timed if the store
modules have already all been compiled and there are no
rawModules. This might be undesirable.

Signed-off-by: Charlie Egan <charlie@styra.com>
2023-01-05 10:47:48 +00:00
Ashutosh Narkar d12e959922 Add support to enable ND builtin cache via discovery (#5468)
This commit adds support for enabling/disabling the ND builtin
cache via the OPA `discovery` plugin.

Fixes: #5457

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
Co-authored-by: Philip Conrad <philipaconrad@gmail.com>
2022-12-19 16:30:11 -05:00
Jay Wineinger ea39bf35b9 Feat: Add support for AWS Signing Version 4A (#5489)
AWS is rolling out an extension to SigV4 called Signature Version 4A (SigV4A)
which enables signatures that are valid in more than one AWS Region. This is
required for signing multi-region API requests, for example with Amazon S3
Multi-Region Access Points (MRAP). This commit lets OPA use an S3 MRAP as
a bundle source.

The SigV4A implementation used in this commit is a modified version of
internal code from the `aws-sdk-go-v2` project:
https://github.com/aws/aws-sdk-go-v2/tree/93c3f18/internal/v4a

This commit also refactors the existing V4 signing code into a shared
`internal/providers/aws` package that contains both the existing V4 signing
code as well as the V4A signing code added by this PR.

Fixes #5429

Signed-off-by: Jay Wineinger <jawineinger@spscommerce.com>
2022-12-19 16:11:50 -05:00
Philip Conrad 1d1cb357ae providers/aws: Refactor + Fix 2x Authorization header append issue. (#5475)
This commit refactors the shared AWS Sig v4 signing code, specifically
to prevent the issue behind #5472. The underlying problem for was
that the `"Authorization"` header was being appended *twice* to the
request, but only for the AWS REST plugin, because the value was pulled
twice from the signed headers map.

This was not caught by the unit tests, because the REST plugin's unit
tests all assumed the header was single-valued and canonicalized.

We now explicitly test for that condition in the unit tests, and the
signing code now returns the AWS headers map separately from the value
for the `"Authorization"` header, reducing the potential for this
mistake to happen in the future.

Fixes: #5472

Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
2022-12-12 10:38:21 -05:00
Philip Conrad ed76301eb6 builtins: Add AWS Sig v4 signing builtin. (#5376)
This commit adds initial support for AWS's SigV4 request signing system,
which will allow OPA's existing `http.send` builtin to be used to more
conveniently query cloud resources. It automates away most of the pain
around signing the request headers and body, and is designed to compose
with `http.send` directly.

Internally, this also refactors AWS SigV4 request signing, so that the
signing logic is shared between the builtin and the REST plugin for AWS.

Fixes: #3749

Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
2022-11-18 15:11:47 -05:00
Phạm Hữu Vinh 25109c9be8 plugins: export TracerProvider (#5277)
This is the OPA side of #4290. It will allow the envoy plugin to wire
the TraceProvider into the gRPC handlers.

Signed-off-by: vinhph0906 <vinhph0906@gmail.com>
2022-10-31 09:28:34 +01:00
Anders Eknert 50d4e31d6b chore: Use t.Setenv in tests (#5321)
And enable the `tenv` linter for the future.

Also, bump version of golangci-lint and fix some new
warnings that came from that.

Signed-off-by: Anders Eknert <anders@eknert.com>
2022-10-27 17:44:56 +02:00
Anders Eknert 9a597feb2e chore: don't use the deprecated ioutil functions (#5319)
Another annoyance removed :P

Signed-off-by: Anders Eknert <anders@eknert.com>
2022-10-27 14:30:26 +02:00
Anders Eknert 95708108f3 linters: add unconvert (#5318)
Got a few warnings from my IDE about redundant type conversions,
so I decided to look into it. Added the unconvert linter to our
checks, and fixed the violations. Added two ignore comments as I
wasn't sure about whether they'd change the semantics of the code.

Signed-off-by: Anders Eknert <anders@eknert.com>
2022-10-27 13:35:39 +02:00
Humberto Corrêa da Silva f1761ac77e server+runtime+logs: Add the req_id attribute on the decision logs (#5196)
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>
2022-10-14 13:12:15 +02:00