You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Enable detailed GitHub API logging for debugging
* Wrapped all GitHub API calls in the provider with a new profiling utility.
* Logged API call duration, requested URL, and remaining rate-limit
information at debug level.
* Provided a new debugging capability for troubleshooting GitHub API
interactions.
* Migrated logging configuration documentation to a new, dedicated file.
* Updated documentation to guide users on enabling detailed API interaction
logs.
Jira: https://issues.redhat.com/browse/SRVKP-7037
Signed-off-by: Chmouel Boudjnah <[email protected]>
Pipelines-as-Code uses a ConfigMap named `pac-config-logging` in its namespace (by default, `pipelines-as-code`) to configure the logging behavior of its controllers.
9
+
10
+
To view the ConfigMap, use the following command:
11
+
12
+
```bash
13
+
kubectl get configmap pac-config-logging -n pipelines-as-code
14
+
```
15
+
16
+
To see the full content of the ConfigMap, run:
17
+
18
+
```bash
19
+
kubectl get configmap pac-config-logging -n pipelines-as-code -o yaml
20
+
```
21
+
22
+
The `data` section of the ConfigMap contains the following keys:
23
+
24
+
*`loglevel.pipelinesascode`: The log level for the `pipelines-as-code-controller` component.
25
+
*`loglevel.pipelines-as-code-webhook`: The log level for the `pipelines-as-code-webhook` component.
26
+
*`loglevel.pac-watcher`: The log level for the `pipelines-as-code-watcher` component.
27
+
28
+
You can change the log level from `info` to `debug` or any other supported value. For example, to set the log level for the `pipelines-as-code-watcher` to `debug`, run:
The controller will automatically pick up the new log level.
35
+
36
+
If you want to use the same log level for all Pipelines-as-Code components, you can remove the individual `loglevel.*` keys. In this case, all components will use the log level defined in the `level` field of the `zap-logger-config`.
The `zap-logger-config` supports the following log levels:
43
+
44
+
*`debug`: Fine-grained debugging information.
45
+
*`info`: Normal operational logging.
46
+
*`warn`: Unexpected but non-critical errors.
47
+
*`error`: Critical errors that are unexpected during normal operation.
48
+
*`dpanic`: Triggers a panic (crash) in development mode.
49
+
*`panic`: Triggers a panic (crash).
50
+
*`fatal`: Immediately exits with a status of 1.
51
+
52
+
For more details, see the [Knative logging documentation](https://knative.dev/docs/serving/observability/logging/config-logging).
53
+
54
+
## Debugging API Interactions
55
+
56
+
If you need to troubleshoot interactions with the Git provider API (e.g., GitHub), you can enable detailed API request logging. This is useful for debugging permission issues or unexpected API responses.
57
+
58
+
To enable this feature, set the log level for the `pipelines-as-code-controller` to `debug`. This will cause the controller to log the duration, URL, and remaining rate-limit for each API call it makes.
59
+
60
+
You can enable this for the main controller with the following `kubectl` command:
Copy file name to clipboardExpand all lines: docs/content/docs/install/settings.md
-88Lines changed: 0 additions & 88 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -403,91 +403,3 @@ A few settings are available to configure this feature:
403
403
The provider set to `GitHub App` by tkn pac bootstrap, used to detect if a
404
404
GitHub App is already configured when a user runs the bootstrap command a
405
405
second time or the `webhook add` command.
406
-
407
-
## Logging Configuration
408
-
409
-
Pipelines-as-Code uses the ConfigMap named `pac-config-logging` in the same namespace (`pipelines-as-code` by default) as the controllers. To get the ConfigMap use the following command:
410
-
411
-
```bash
412
-
$ kubectl get configmap pac-config-logging -n pipelines-as-code
413
-
414
-
NAME DATA AGE
415
-
pac-config-logging 4 9m44s
416
-
```
417
-
418
-
To retrieve the content of the ConfigMap:
419
-
420
-
```bash
421
-
$ kubectl get configmap pac-config-logging -n pipelines-as-code -o yaml
422
-
423
-
apiVersion: v1
424
-
kind: ConfigMap
425
-
metadata:
426
-
labels:
427
-
app.kubernetes.io/instance: default
428
-
app.kubernetes.io/part-of: pipelines-as-code
429
-
name: pac-config-logging
430
-
namespace: pipelines-as-code
431
-
data:
432
-
loglevel.pac-watcher: info
433
-
loglevel.pipelines-as-code-webhook: info
434
-
loglevel.pipelinesascode: info
435
-
zap-logger-config: |
436
-
{
437
-
"level": "info",
438
-
"development": false,
439
-
"sampling": {
440
-
"initial": 100,
441
-
"thereafter": 100
442
-
},
443
-
"outputPaths": ["stdout"],
444
-
"errorOutputPaths": ["stderr"],
445
-
"encoding": "json",
446
-
"encoderConfig": {
447
-
"timeKey": "ts",
448
-
"levelKey": "level",
449
-
"nameKey": "logger",
450
-
"callerKey": "caller",
451
-
"messageKey": "msg",
452
-
"stacktraceKey": "stacktrace",
453
-
"lineEnding": "",
454
-
"levelEncoder": "",
455
-
"timeEncoder": "iso8601",
456
-
"durationEncoder": "",
457
-
"callerEncoder": ""
458
-
}
459
-
}
460
-
```
461
-
462
-
The `loglevel.*` fields define the log level for the controllers:
463
-
464
-
* loglevel.pipelinesascode - the log level for the pipelines-as-code-controller component
465
-
* loglevel.pipelines-as-code-webhook - the log level for the pipelines-as-code-webhook component
466
-
* loglevel.pac-watcher - the log level for the pipelines-as-code-watcher component
467
-
468
-
You can change the log level from `info` to `debug` or any other supported values. For example, select the `debug` log level for the pipelines-as-code-watcher component:
0 commit comments