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
The telemetry files may be written at any point during the build. They should
110
-
exist as a part of the build file system for the duration of the build.
111
-
Telemetry files will not be included in the final image.
203
+
Telemetry files may be written at any point during the build, so that they
204
+
are persisted in cases of failures to detect, failures to build, process
205
+
terminations, or crashes. The `jsonl` format allows telemetry libraries to
206
+
safely append additional json objects to the end of a telemetry file, so
207
+
telemetry data can be flushed to the file frequently. Telemetry files should
208
+
not be truncated or deleted so that telemetry processing by a platform can
209
+
happen during or after a build. Telemetry files should not be included in the
210
+
build result, as they are not relevant, and would likely negatively impact
211
+
image size and reproduceability.
112
212
113
213
### Access
114
214
115
-
The telemetry files should remain readable so that they may be analyzed by
116
-
the user and/or platform. However, they should be write protected in some way to prevent
117
-
malicious buildpacks from injecting tracing data into other buildpack's
118
-
telemetry file.
215
+
The telemetry files should be readable so that they may be analyzed by
216
+
the user and/or platform. However, they should be write protected
217
+
to prevent malicious buildpacks from injecting tracing data into other
218
+
buildpack or lifecycle telemetry files.
219
+
220
+
221
+
### Consumption
222
+
223
+
This RFC leaves the consumption of telemetry files to the platform operator.
224
+
Platform operators choosing to use these metrics need to read them either during
225
+
or after the build. This can be done using existing OpenTelemetry libraries.
226
+
Platform operators may choose to optionally enrich or modify the tracing data
227
+
as they see fit (with data like `instance_id` or `build_id`). Platform
228
+
operators will likely want to export this data to an OpenTelemetry backend for
229
+
persistence and analysis, and again, this may be done with existing
230
+
OpenTelemetry libraries.
119
231
232
+
### Viewing and Analyzing
233
+
234
+
Once the lifecycle and buildpack traces are exported to an OpenTelemetry
235
+
backend, platform operators should be able to (depending on the features of the
236
+
backend):
237
+
238
+
- View the complete trace for a build
239
+
- View or query attributes attached to spans (e.g. `buildpack_id`,
240
+
`nodejs_version`)
241
+
- View or query span durations
242
+
- View or query error types and/or messages
243
+
- and more
120
244
121
245
# Migration
122
246
[migration]: #migration
@@ -142,6 +266,13 @@ design:
142
266
usernames, IP addresses, etc.), so the telemetry data emitted by `lifecycle`
143
267
will also be free of user-identifiaible data.
144
268
269
+
### File Export Format Status
270
+
271
+
While the [File Exporter
272
+
Format](https://opentelemetry.io/docs/specs/otel/protocol/file-exporter/) is
273
+
an official format, and matches the OTLP format nearly exactly (and thus seems
274
+
unlikely to change), it is listed as experimental status.
275
+
145
276
# Alternatives
146
277
[alternatives]: #alternatives
147
278
@@ -154,6 +285,28 @@ provide statistical information in aggregate. Since `lifecycle` and `pack`
154
285
only run one build at a time, there is no way to aggregate information about
155
286
multiple builds in `pack` or `lifecycle`.
156
287
288
+
### OTLP
289
+
290
+
The [OpenTelemetryProtocol](https://opentelemetry.io/docs/specs/otlp/) is a
291
+
network delivery protocol for OpenTelemetry data. Instead of emitting files as
292
+
this RFC describes, lifecycle and buildpacks could instead connect to an
293
+
OpenTelemetry collector provided by the platform operator. This pattern is
294
+
well supported and well known.
295
+
296
+
However, there are drawbacks:
297
+
298
+
- In local `pack build` scenarios, it's unlikely that users would have an
299
+
OpenTelemetry collector running. This RFC solution does not require a
300
+
collector.
301
+
- lifecycle and buildpacks would need to know where the OpenTelemetry collector
302
+
is and how to authenticate with it. Lifecycle and buildpacks that wish to
303
+
emit telemetry may not want to deal with the mountain of configuration to
304
+
support various collectors.
305
+
- Platform operators may have complex network topology that may make supporting
306
+
this feature challenging (e.g. a firewall between lifecycle and the collector
307
+
may still be perceived as a lifecycle malfunction).
308
+
309
+
There is an [RFC for this alternative](https://github.com/buildpacks/rfcs/pull/300).
157
310
158
311
# Prior Art
159
312
[prior-art]: #prior-art
@@ -177,10 +330,6 @@ Discuss prior art, both the good and bad.
177
330
shouldn't be a part of the build result image.
178
331
179
332
180
-
- What parts of the design do you expect to be resolved before this gets merged?
181
-
- What parts of the design do you expect to be resolved through implementation of the feature?
182
-
- What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC?
0 commit comments