Skip to content

Commit a25039f

Browse files
committed
update to include date formating
1 parent 498711e commit a25039f

File tree

1 file changed

+35
-18
lines changed

1 file changed

+35
-18
lines changed

enhancements/cluster-logging/forwarder-to-s3.md

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ superseded-by: []
2727
## Summary
2828

2929
This feature adds support for collecting logs using the Red Hat Logging Operator and forwarding them
30-
to an S3 configured endpoint. The enhancements to ClusterLogForwarder include API changes to: allow
30+
to an S3 configured endpoint. The enhancements to **ClusterLogForwarder** include API changes to: allow
3131
administrators to utilize "assume role" authentication functionality that is provided by the underlying platform,
32-
and rely upon "sane" defaults for organizing the bucket
32+
and rely upon "sane" defaults for organizing records in an S3 bucket.
3333

3434
## Motivation
3535

3636
The primary motivation for this proposal is to satisfy functionality requests from Red Hat managed services teams
3737
which are providing managed clusters for customers. They have requirements to be able to collect, forward, and store logs
3838
from both the hosted control plane and the management clusters utilizing credentials from multiple organizations in a
39-
cost efficient manor.
39+
cost efficient manner.
4040

4141
### User Stories
4242

@@ -50,8 +50,8 @@ otherwise exceed the size limits of Cloudwatch
5050
### Goals
5151

5252
* A simple API for an specifying log forwarding to an S3 output
53-
* A set of sane defaults for organizing log streams written to the user defined bucket
54-
* The ability to modify the way log streams are organized when written to the user defined bucket
53+
* A set of sane defaults for organizing log streams written to the specified S3 bucket
54+
* The capability to define how log streams are organized when written to the specified S3 bucket
5555
* Re-use existing AWS authentication features provided by the Cloudwatch output
5656

5757
### Non-Goals
@@ -62,19 +62,21 @@ otherwise exceed the size limits of Cloudwatch
6262

6363
This enhancement proposes to:
6464

65-
* Enhance the ClusterLogForwarder API to add an S3 output
65+
* Enhance the **ClusterLogForwarder** API to add an S3 output
6666
* Define a default schema for writing log records to an S3 bucket that is based
67-
upon the log type and source which is consistent with other output types
67+
upon the log type and source in order to be consistent with other output types
6868
* Allow the schema for writting log records to be modified by the administrator
6969
* Reuse the authorization mechanisms that are available with the Cloudwatch output
70-
* Add a generator to support generating collector configuration based upon the spec defined in the ClusterLogForwarder API
70+
* Add a generator to support generating collector configuration based upon the spec defined by the **ClusterLogForwarder** API
7171

7272

7373
### Workflow Description
7474

75-
**cluster administrator** is a human responsible for administering the **cluster-logging-operator**
75+
**Cluster administrator** is a human responsible for administering the **cluster-logging-operator**
7676
and **ClusterLogForwarders**
7777

78+
1. The cluster administrator creates an S3 bucket on their host platform (i.e. AWS)
79+
1. The cluster administrator grants a platform role (i.e. IAM Role) the permissions to write to the S3 bucket
7880
1. The cluster administrator deployes the cluster-logging-operator if it is already not deployed
7981
1. The cluster administrator edits or creates a **ClusterLogForwarder** and defines an S3 output
8082
1. The cluster administrator references the S3 output in a pipeline
@@ -91,12 +93,12 @@ kind: ClusterLogForwarder
9193
spec:
9294
outputs:
9395
- name:
94-
type: # add s3 to the enum
96+
type: s3 # add s3 to the enum
9597
tls: {}
9698
s3:
97-
url: # (optional)
99+
url: # (optional) string is an alternate to the well-known AWS endpoints
98100
region: # (optional) string that is different from the configured service default
99-
bucker: # string for the S3 bucket absent leading 's3://' or trailing '/'
101+
bucket: # string for the S3 bucket absent leading 's3://' or trailing '/'
100102
keyPrefix: # (optional) templated string (see note 1)
101103
authentication:
102104
type: # enum: awsAccessKey, iamRole
@@ -109,21 +111,34 @@ outputs:
109111
token: # bearer token
110112
assumeRole: # (optional)
111113
roleARN: # secret reference
112-
externalID: # (optional) secret reference
113-
tuning:
114+
externalID: # (optional)string
114115
delivery: # (optional) atLeastOnce, atMostOnce
115116
maxWrite: # (optional) quantity (e.g. 500k)
116117
compression: # (optional) none, gzip,zstd,snappy,zlib
117118
minRetryDuration: # (optional) duration
118119
maxRetryDuration: # (optional) duration
119120
```
120121
121-
**Note 1:** A combination of static and dynamic values consisting of field paths followed by "||" followed by another field path or a static value (e.g `foo.{.bar.baz||.qux.quux.corge||.grault||"nil"}-waldo.fred{.plugh||"none"}`)
122+
**Note 1:** A combination of date formatters, static or dynamic values consisting of field paths followed by "||" followed by another field path or a static value (e.g `foo.{"%Y-%m-%d"}/{.bar.baz||.qux.quux.corge||.grault||"nil"}-waldo.fred{.plugh||"none"}`)
123+
124+
Date formatters are specified using one or more of the following subset of [chrono](https://docs.rs/chrono/latest/chrono/format/strftime/index.html#specifiers)
125+
specifiers to format the `.timestamp` field value:
126+
127+
| Spec | Example | Description |
128+
|------|---------|-------------|
129+
| %F | 2001-07-08| Year-month-day format (ISO 8601). Same as %Y-%m-%d.|
130+
| %Y | 2001 |The full proleptic Gregorian year, zero-padded to 4 digits
131+
| %m | 07 | Month number (01–12), zero-padded to 2 digits.|
132+
| %d |08|Day number (01–31), zero-padded to 2 digits.|
133+
| %H |00|Hour number (00–23), zero-padded to 2 digits.|
134+
| %M |34|Minute number (00–59), zero-padded to 2 digits.|
135+
| %S |60|Second number (00–60), zero-padded to 2 digits.|
136+
122137
**Note 2:** The collector will encode events as [JSON](https://www.rfc-editor.org/rfc/rfc8259)
123138

124139
#### ViaQ DataModel API
125140

126-
The collector will write logs to the s3 bucket defaulting the key prefix that is constructed using attributes of the log entries when not defined by the ClusterLogForwarder spec as follows:
141+
The collector will write logs to the s3 bucket defaulting the key prefix that is constructed using attributes of the log entries when not defined by the **ClusterLogForwarder** spec as follows:
127142

128143
| log type| log source | key prefix |
129144
| --- | --- | --- |
@@ -169,18 +184,20 @@ Additionally, this change may be interpreted as a "reliable" delivery mechanism
169184
is still misleading. The OpenShift logging product is not a guaranted log collection and storage system and this
170185
output will remain subject to the same set of limitations as all other outputs.
171186

187+
Lastly, using this output provides no mechanism to query log records in a useful manner that is offered by other outputs (i.e. LokiStack). The available "metadata" is dependent upon the definition of the "keyPrefix" when the logs are written to S3. If the "keyPrefix" does not provide useful way to organize the data then retrieval of that data will be challenging.
188+
172189
## Alternatives (Not Implemented)
173190

174191

175192
## Open Questions [optional]
176193

177194
1. Do we need to support `filename_time_format` to address the key prefix functionality proposed by the draft [PR](https://github.com/openshift/cluster-logging-operator/pull/3096)
195+
* All indicators are that we need some way to provide a way for users to inject a formatted date into the "keyPrefix" field in order to provide logical organization of the records when written to the bucket
178196
2. Is there a need to introduce this feature as tech-preview with a `v2beta1` API to allow the "soak" time for the API and additional testing?
179197

180198
## Test Plan
181199

182-
Aside from the usual testing by logging QE, the intent is to deploy, potentially early canidate releases, to the HCP
183-
environment for them to exercise their S3 lambda design
200+
Aside from the usual testing by logging QE, the intent is to deploy, potentially early candidate releases, to the HCP environment in order to exercise their S3 lambda design
184201

185202
## Graduation Criteria
186203

0 commit comments

Comments
 (0)