Skip to content

Commit 72e2b36

Browse files
authored
interceptor: make request logging optional (#1375)
* interceptor: make request logging optional Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> * fix lychee base url Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> --------- Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
1 parent 9b21a5a commit 72e2b36

File tree

7 files changed

+13
-8
lines changed

7 files changed

+13
-8
lines changed

.github/ISSUE_TEMPLATE/3_release_tracker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ assignees: tomkerkhove,jorturfer
88

99
This issue template is used to track the rollout of a new KEDA HTTP add-on version.
1010

11-
For the full release process, we recommend reading [this document]([https://github.com/kedacore/keda/blob/main/RELEASE-PROCESS.md](https://github.com/kedacore/http-add-on/blob/main/RELEASE-PROCESS.md)).
11+
For the full release process, we recommend reading [this document](https://github.com/kedacore/http-add-on/blob/main/RELEASE-PROCESS.md).
1212

1313
## Required items
1414

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ _Provide a description of what has been changed_
1212
- [ ] Changelog has been updated and is aligned with our [changelog requirements](https://github.com/kedacore/keda/blob/main/CONTRIBUTING.md#Changelog)
1313
- [ ] Any necessary documentation is added, such as:
1414
- [`README.md`](../README.md)
15-
- [The `docs/` directory](./docs)
15+
- [The `docs/` directory](../docs)
1616
- [The docs repo](https://github.com/kedacore/keda-docs)
1717

1818
Fixes #

.github/workflows/linkinator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: lycheeverse/lychee-action@v2
2828
with:
2929
args: >
30-
--base-url "."
30+
--root-dir "${{ github.workspace }}"
3131
--cache --max-cache-age 1d
3232
--max-concurrency 6
3333
--max-retries 6

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ This changelog keeps track of work items that have been completed and are ready
3131

3232
### Improvements
3333

34-
- **General**: TODO ([#TODO](https://github.com/kedacore/http-add-on/issues/TODO))
34+
- **General**: Make interceptor request logging optional ([#1375](https://github.com/kedacore/http-add-on/pull/1375))
3535

3636
### Fixes
3737

docs/operate.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,8 @@ Optional variables
7070
`OTEL_EXPORTER_OTLP_TRACES_INSECURE` - To send traces to the tracing via HTTP rather than HTTPS (`false` by default)
7171
`OTEL_EXPORTER_OTLP_TRACES_TIMEOUT` - The batcher timeout in seconds to send batch of data points (`5` by default)
7272

73+
### Configuring interceptor proxy request logging
74+
75+
The interceptor proxy can log incoming requests for debugging and monitoring purposes. Request logging can be enabled by setting the `KEDA_HTTP_LOG_REQUESTS` environment variable to `true` on the interceptor deployment (`false` by default).
76+
7377
### Configuring Service Failover

interceptor/config/serving.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ type Serving struct {
5151
ProfilingAddr string `envconfig:"PROFILING_BIND_ADDRESS" default:""`
5252
// EnableColdStartHeader enables/disables the X-KEDA-HTTP-Cold-Start response header
5353
EnableColdStartHeader bool `envconfig:"KEDA_HTTP_ENABLE_COLD_START_HEADER" default:"true"`
54+
// LogRequests enables/disables logging of incoming requests
55+
LogRequests bool `envconfig:"KEDA_HTTP_LOG_REQUESTS" default:"false"`
5456
}
5557

5658
// Parse parses standard configs using envconfig and returns a pointer to the

interceptor/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,9 @@ func runProxyServer(
463463
rootHandler = otelhttp.NewHandler(rootHandler, "keda-http-interceptor")
464464
}
465465

466-
rootHandler = middleware.NewLogging(
467-
logger,
468-
rootHandler,
469-
)
466+
if serving.LogRequests {
467+
rootHandler = middleware.NewLogging(logger, rootHandler)
468+
}
470469

471470
rootHandler = middleware.NewMetrics(
472471
rootHandler,

0 commit comments

Comments
 (0)