Skip to content

Commit 688febc

Browse files
committed
docs(tektonresult): document that watcher.logs_api is needed to store logs
Setting the top-level logs_api only enables the logs API on the Results API server. The watcher forwards TaskRun and PipelineRun logs to it only when its own logs_api flag is set, which defaults to false, so the documented File/PVC example stored no logs. Add watcher.logs_api to the TektonResult and TektonConfig examples, explain when to set it and when another forwarder makes it unnecessary, and note that log forwarding by the watcher is expected to be removed in a future release. Report: #2600 Signed-off-by: Pujitha Paladugu <[email protected]>
1 parent f407f97 commit 688febc

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎docs/TektonConfig.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ result:
355355
check_owner: true
356356
store_deadline: 10m
357357
disable_storing_incomplete_runs: true
358+
logs_api: true # leave unset when another forwarder stores logs; see the logs_api note in TektonResult.md
358359
```
359360
360361
#### Tekton Results Watcher configuration
@@ -394,7 +395,7 @@ result:
394395
| `check_owner` | `-check_owner` | `true` | Skip deletion when the Run has owner references. |
395396
| `store_deadline` | `-store_deadline` | `10m` | Max wait to store a Run before clearing its finalizer on delete. |
396397
| `disable_storing_incomplete_runs` | `-disable_storing_incomplete_runs` | `false` | Only store Runs after they complete. |
397-
| `logs_api` | `-logs_api` | `false` | Send logs to the Results API (separate from API server `logs_api`). |
398+
| `logs_api` | `-logs_api` | `false` | Send logs to the Results API (separate from API server `logs_api`). Without it, the top-level `logs_api` stores no logs unless another forwarder sends them. Expected to be removed in a future release. |
398399
| `logs_timestamps` | `-logs_timestamps` | `false` | Include timestamps in stored logs. |
399400
| `store_event` | `-store_event` | `false` | Store Kubernetes events related to Runs. |
400401
| `summary_labels` | `-summary_labels` | `tekton.dev/pipeline` | Comma-separated labels copied into Result summary. Omit to keep default; `""` clears it. |

‎docs/TektonResult.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,18 @@ spec:
7070
loki_stack_namespace: #optional
7171
prometheus_port: 9090
7272
prometheus_histogram: false
73+
watcher:
74+
logs_api: true # leave unset when another forwarder stores logs; see the note below
7375
```
7476
7577
These properties are analogous to the one in configmap of tekton results api `tekton-results-api-config` documented at [api.md](https://github.com/tektoncd/results/blob/4472848a0fb7c1473cfca8b647553170efac78a1/cmd/api/README.md)
7678

79+
> **Note:** `logs_api: true` enables the logs API on the Results API server only. The watcher forwards TaskRun and
80+
> PipelineRun logs to it only when `watcher.logs_api` is also `true` (it defaults to `false`). With only the top-level
81+
> field set, no logs are stored, for example with the `logs_type: File` and `logging_pvc_name` setup above. Leave
82+
> `watcher.logs_api` unset when another forwarder stores the logs, such as Vector or Fluentd with
83+
> [LokiStack](#lokistack--tektonresult). Log forwarding by the watcher is expected to be removed in a future release.
84+
7785

7886
[result]:https://github.com/tektoncd/results
7987

0 commit comments

Comments
 (0)