Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/grafana-agent
Path: blob/main/production/operator/crds/monitoring.grafana.com_podlogs.yaml
4096 views
1
---
2
apiVersion: apiextensions.k8s.io/v1
3
kind: CustomResourceDefinition
4
metadata:
5
annotations:
6
controller-gen.kubebuilder.io/version: v0.9.2
7
creationTimestamp: null
8
name: podlogs.monitoring.grafana.com
9
spec:
10
group: monitoring.grafana.com
11
names:
12
categories:
13
- agent-operator
14
kind: PodLogs
15
listKind: PodLogsList
16
plural: podlogs
17
singular: podlogs
18
scope: Namespaced
19
versions:
20
- name: v1alpha1
21
schema:
22
openAPIV3Schema:
23
description: PodLogs defines how to collect logs for a pod.
24
properties:
25
apiVersion:
26
description: 'APIVersion defines the versioned schema of this representation
27
of an object. Servers should convert recognized schemas to the latest
28
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
29
type: string
30
kind:
31
description: 'Kind is a string value representing the REST resource this
32
object represents. Servers may infer this from the endpoint the client
33
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
34
type: string
35
metadata:
36
type: object
37
spec:
38
description: Spec holds the specification of the desired behavior for
39
the PodLogs.
40
properties:
41
jobLabel:
42
description: The label to use to retrieve the job name from.
43
type: string
44
namespaceSelector:
45
description: Selector to select which namespaces the Pod objects are
46
discovered from.
47
properties:
48
any:
49
description: Boolean describing whether all namespaces are selected
50
in contrast to a list restricting them.
51
type: boolean
52
matchNames:
53
description: List of namespace names to select from.
54
items:
55
type: string
56
type: array
57
type: object
58
pipelineStages:
59
description: Pipeline stages for this pod. Pipeline stages support
60
transforming and filtering log lines.
61
items:
62
description: "PipelineStageSpec defines an individual pipeline stage.
63
Each stage type is mutually exclusive and no more than one may
64
be set per stage. \n More information on pipelines can be found
65
in the Promtail documentation: https://grafana.com/docs/loki/latest/clients/promtail/pipelines/"
66
properties:
67
cri:
68
description: 'CRI is a parsing stage that reads log lines using
69
the standard CRI logging format. Supply cri: {} to enable.'
70
type: object
71
docker:
72
description: 'Docker is a parsing stage that reads log lines
73
using the standard Docker logging format. Supply docker: {}
74
to enable.'
75
type: object
76
drop:
77
description: Drop is a filtering stage that lets you drop certain
78
logs.
79
properties:
80
dropCounterReason:
81
description: Every time a log line is dropped, the metric
82
logentry_dropped_lines_total is incremented. A "reason"
83
label is added, and can be customized by providing a custom
84
value here. Defaults to "drop_stage".
85
type: string
86
expression:
87
description: "RE2 regular expression. \n If source is provided,
88
the regex attempts to match the source. \n If no source
89
is provided, then the regex attempts to attach the log
90
line. \n If the provided regex matches the log line or
91
a provided source, the line is dropped."
92
type: string
93
longerThan:
94
description: LongerThan will drop a log line if it its content
95
is longer than this value (in bytes). Can be expressed
96
as an integer (8192) or a number with a suffix (8kb).
97
type: string
98
olderThan:
99
description: OlderThan will be parsed as a Go duration.
100
If the log line's timestamp is older than the current
101
time minus the provided duration, it will be dropped.
102
type: string
103
source:
104
description: Name from the extract data to parse. If empty,
105
uses the log message.
106
type: string
107
value:
108
description: "Value can only be specified when source is
109
specified. If the value provided is an exact match for
110
the given source then the line will be dropped. \n Mutually
111
exclusive with expression."
112
type: string
113
type: object
114
json:
115
description: "JSON is a parsing stage that reads the log line
116
as JSON and accepts JMESPath expressions to extract data.
117
\n Information on JMESPath: http://jmespath.org/"
118
properties:
119
expressions:
120
additionalProperties:
121
type: string
122
description: "Set of the key/value pairs of JMESPath expressions.
123
The key will be the key in the extracted data while the
124
expression will be the value, evaluated as a JMESPath
125
from the source data. \n Literal JMESPath expressions
126
can be used by wrapping a key in double quotes, which
127
then must be wrapped again in single quotes in YAML so
128
they get passed to the JMESPath parser."
129
type: object
130
source:
131
description: Name from the extracted data to parse as JSON.
132
If empty, uses entire log message.
133
type: string
134
type: object
135
labelAllow:
136
description: LabelAllow is an action stage that only allows
137
the provided labels to be included in the label set that is
138
sent to Loki with the log entry.
139
items:
140
type: string
141
type: array
142
labelDrop:
143
description: LabelDrop is an action stage that drops labels
144
from the label set that is sent to Loki with the log entry.
145
items:
146
type: string
147
type: array
148
labels:
149
additionalProperties:
150
type: string
151
description: "Labels is an action stage that takes data from
152
the extracted map and modifies the label set that is sent
153
to Loki with the log entry. \n The key is REQUIRED and represents
154
the name for the label that will be created. Value is optional
155
and will be the name from extracted data to use for the value
156
of the label. If the value is not provided, it defaults to
157
match the key."
158
type: object
159
limit:
160
description: Limit is a rate-limiting stage that throttles logs
161
based on several options.
162
properties:
163
burst:
164
description: The cap in the quantity of burst lines that
165
Promtail will push to Loki.
166
type: integer
167
drop:
168
description: "When drop is true, log lines that exceed the
169
current rate limit are discarded. When drop is false,
170
log lines that exceed the current rate limit wait to enter
171
the back pressure mode. \n Defaults to false."
172
type: boolean
173
rate:
174
description: The rate limit in lines per second that Promtail
175
will push to Loki.
176
type: integer
177
type: object
178
match:
179
description: Match is a filtering stage that conditionally applies
180
a set of stages or drop entries when a log entry matches a
181
configurable LogQL stream selector and filter expressions.
182
properties:
183
action:
184
description: Determines what action is taken when the selector
185
matches the log line. Can be keep or drop. Defaults to
186
keep. When set to drop, entries are dropped and no later
187
metrics are recorded. Stages must be empty when dropping
188
metrics.
189
type: string
190
dropCounterReason:
191
description: Every time a log line is dropped, the metric
192
logentry_dropped_lines_total is incremented. A "reason"
193
label is added, and can be customized by providing a custom
194
value here. Defaults to "match_stage."
195
type: string
196
pipelineName:
197
description: Names the pipeline. When defined, creates an
198
additional label in the pipeline_duration_seconds histogram,
199
where the value is concatenated with job_name using an
200
underscore.
201
type: string
202
selector:
203
description: LogQL stream selector and filter expressions.
204
Required.
205
type: string
206
stages:
207
description: "Nested set of pipeline stages to execute when
208
action is keep and the log line matches selector. \n An
209
example value for stages may be: \n stages: | - json:
210
{} - labelAllow: [foo, bar] \n Note that stages is a string
211
because SIG API Machinery does not support recursive types,
212
and so it cannot be validated for correctness. Be careful
213
not to mistype anything."
214
type: string
215
required:
216
- selector
217
type: object
218
metrics:
219
additionalProperties:
220
description: MetricsStageSpec is an action stage that allows
221
for defining and updating metrics based on data from the
222
extracted map. Created metrics are not pushed to Loki or
223
Prometheus and are instead exposed via the /metrics endpoint
224
of the Grafana Agent pod. The Grafana Agent Operator should
225
be configured with a MetricsInstance that discovers the
226
logging DaemonSet to collect metrics created by this stage.
227
properties:
228
action:
229
description: "The action to take against the metric. Required.
230
\n Must be either \"inc\" or \"add\" for type: counter
231
or type: histogram. When type: gauge, must be one of
232
\"set\", \"inc\", \"dec\", \"add\", or \"sub\". \n \"add\",
233
\"set\", or \"sub\" requires the extracted value to
234
be convertible to a positive float."
235
type: string
236
buckets:
237
description: 'Buckets to create. Bucket values must be
238
convertible to float64s. Extremely large or small numbers
239
are subject to some loss of precision. Only valid for
240
type: histogram.'
241
items:
242
type: string
243
type: array
244
countEntryBytes:
245
description: "If true all log line bytes are counted.
246
Can only be set with matchAll: true and action: add.
247
\n Only valid for type: counter."
248
type: boolean
249
description:
250
description: Sets the description for the created metric.
251
type: string
252
matchAll:
253
description: "If true, all log lines are counted without
254
attempting to match the source to the extracted map.
255
Mutually exclusive with value. \n Only valid for type:
256
counter."
257
type: boolean
258
maxIdleDuration:
259
description: "Label values on metrics are dynamic which
260
can cause exported metrics to go stale. To prevent unbounded
261
cardinality, any metrics not updated within MaxIdleDuration
262
are removed. \n Must be greater or equal to 1s. Defaults
263
to 5m."
264
type: string
265
prefix:
266
description: Sets the custom prefix name for the metric.
267
Defaults to "promtail_custom_".
268
type: string
269
source:
270
description: Key from the extracted data map to use for
271
the metric. Defaults to the metrics name if not present.
272
type: string
273
type:
274
description: The metric type to create. Must be one of
275
counter, gauge, histogram. Required.
276
type: string
277
value:
278
description: Filters down source data and only changes
279
the metric if the targeted value matches the provided
280
string exactly. If not present, all data matches.
281
type: string
282
required:
283
- action
284
- type
285
type: object
286
description: Metrics is an action stage that supports defining
287
and updating metrics based on data from the extracted map.
288
Created metrics are not pushed to Loki or Prometheus and are
289
instead exposed via the /metrics endpoint of the Grafana Agent
290
pod. The Grafana Agent Operator should be configured with
291
a MetricsInstance that discovers the logging DaemonSet to
292
collect metrics created by this stage.
293
type: object
294
multiline:
295
description: Multiline stage merges multiple lines into a multiline
296
block before passing it on to the next stage in the pipeline.
297
properties:
298
firstLine:
299
description: RE2 regular expression. Creates a new multiline
300
block when matched. Required.
301
type: string
302
maxLines:
303
description: Maximum number of lines a block can have. A
304
new block is started if the number of lines surpasses
305
this value. Defaults to 128.
306
type: integer
307
maxWaitTime:
308
description: Maximum time to wait before passing on the
309
multiline block to the next stage if no new lines are
310
received. Defaults to 3s.
311
type: string
312
required:
313
- firstLine
314
type: object
315
output:
316
description: Output stage is an action stage that takes data
317
from the extracted map and changes the log line that will
318
be sent to Loki.
319
properties:
320
source:
321
description: Name from extract data to use for the log entry.
322
Required.
323
type: string
324
required:
325
- source
326
type: object
327
pack:
328
description: Pack is a transform stage that lets you embed extracted
329
values and labels into the log line by packing the log line
330
and labels inside of a JSON object.
331
properties:
332
ingestTimestamp:
333
description: If the resulting log line should use any existing
334
timestamp or use time.Now() when the line was created.
335
Set to true when combining several log streams from different
336
containers to avoid out of order errors.
337
type: boolean
338
labels:
339
description: Name from extracted data or line labels. Required.
340
Labels provided here are automatically removed from output
341
labels.
342
items:
343
type: string
344
type: array
345
required:
346
- labels
347
type: object
348
regex:
349
description: Regex is a parsing stage that parses a log line
350
using a regular expression. Named capture groups in the regex
351
allows for adding data into the extracted map.
352
properties:
353
expression:
354
description: RE2 regular expression. Each capture group
355
MUST be named. Required.
356
type: string
357
source:
358
description: Name from extracted data to parse. If empty,
359
defaults to using the log message.
360
type: string
361
required:
362
- expression
363
type: object
364
replace:
365
description: Replace is a parsing stage that parses a log line
366
using a regular expression and replaces the log line. Named
367
capture groups in the regex allows for adding data into the
368
extracted map.
369
properties:
370
expression:
371
description: RE2 regular expression. Each capture group
372
MUST be named. Required.
373
type: string
374
replace:
375
description: Value to replace the captured group with.
376
type: string
377
source:
378
description: Name from extracted data to parse. If empty,
379
defaults to using the log message.
380
type: string
381
required:
382
- expression
383
type: object
384
template:
385
description: Template is a transform stage that manipulates
386
the values in the extracted map using Go's template syntax.
387
properties:
388
source:
389
description: Name from extracted data to parse. Required.
390
If empty, defaults to using the log message.
391
type: string
392
template:
393
description: Go template string to use. Required. In addition
394
to normal template functions, ToLower, ToUpper, Replace,
395
Trim, TrimLeft, TrimRight, TrimPrefix, and TrimSpace are
396
also available.
397
type: string
398
required:
399
- source
400
- template
401
type: object
402
tenant:
403
description: Tenant is an action stage that sets the tenant
404
ID for the log entry picking it from a field in the extracted
405
data map. If the field is missing, the default LogsClientSpec.tenantId
406
will be used.
407
properties:
408
label:
409
description: Name from labels whose value should be set
410
as tenant ID. Mutually exclusive with source and value.
411
type: string
412
source:
413
description: Name from extracted data to use as the tenant
414
ID. Mutually exclusive with label and value.
415
type: string
416
value:
417
description: Value to use for the template ID. Useful when
418
this stage is used within a conditional pipeline such
419
as match. Mutually exclusive with label and source.
420
type: string
421
type: object
422
timestamp:
423
description: Timestamp is an action stage that can change the
424
timestamp of a log line before it is sent to Loki. If not
425
present, the timestamp of a log line defaults to the time
426
when the log line was read.
427
properties:
428
actionOnFailure:
429
description: Action to take when the timestamp can't be
430
extracted or parsed. Can be skip or fudge. Defaults to
431
fudge.
432
type: string
433
fallbackFormats:
434
description: Fallback formats to try if format fails.
435
items:
436
type: string
437
type: array
438
format:
439
description: 'Determines format of the time string. Required.
440
Can be one of: ANSIC, UnixDate, RubyDate, RFC822, RFC822Z,
441
RFC850, RFC1123, RFC1123Z, RFC3339, RFC3339Nano, Unix,
442
UnixMs, UnixUs, UnixNs.'
443
type: string
444
location:
445
description: IANA Timezone Database string.
446
type: string
447
source:
448
description: Name from extracted data to use as the timestamp.
449
Required.
450
type: string
451
required:
452
- format
453
- source
454
type: object
455
type: object
456
type: array
457
podTargetLabels:
458
description: PodTargetLabels transfers labels on the Kubernetes Pod
459
onto the target.
460
items:
461
type: string
462
type: array
463
relabelings:
464
description: "RelabelConfigs to apply to logs before delivering. Grafana
465
Agent Operator automatically adds relabelings for a few standard
466
Kubernetes fields and replaces original scrape job name with __tmp_logs_job_name.
467
\n More info: https://grafana.com/docs/loki/latest/clients/promtail/configuration/#relabel_configs"
468
items:
469
description: 'RelabelConfig allows dynamic rewriting of the label
470
set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section
471
of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
472
properties:
473
action:
474
default: replace
475
description: Action to perform based on regex matching. Default
476
is 'replace'. uppercase and lowercase actions require Prometheus
477
>= 2.36.
478
enum:
479
- replace
480
- Replace
481
- keep
482
- Keep
483
- drop
484
- Drop
485
- hashmod
486
- HashMod
487
- labelmap
488
- LabelMap
489
- labeldrop
490
- LabelDrop
491
- labelkeep
492
- LabelKeep
493
- lowercase
494
- Lowercase
495
- uppercase
496
- Uppercase
497
type: string
498
modulus:
499
description: Modulus to take of the hash of the source label
500
values.
501
format: int64
502
type: integer
503
regex:
504
description: Regular expression against which the extracted
505
value is matched. Default is '(.*)'
506
type: string
507
replacement:
508
description: Replacement value against which a regex replace
509
is performed if the regular expression matches. Regex capture
510
groups are available. Default is '$1'
511
type: string
512
separator:
513
description: Separator placed between concatenated source label
514
values. default is ';'.
515
type: string
516
sourceLabels:
517
description: The source labels select values from existing labels.
518
Their content is concatenated using the configured separator
519
and matched against the configured regular expression for
520
the replace, keep, and drop actions.
521
items:
522
description: LabelName is a valid Prometheus label name which
523
may only contain ASCII letters, numbers, as well as underscores.
524
pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
525
type: string
526
type: array
527
targetLabel:
528
description: Label to which the resulting value is written in
529
a replace action. It is mandatory for replace actions. Regex
530
capture groups are available.
531
type: string
532
type: object
533
type: array
534
selector:
535
description: Selector to select Pod objects. Required.
536
properties:
537
matchExpressions:
538
description: matchExpressions is a list of label selector requirements.
539
The requirements are ANDed.
540
items:
541
description: A label selector requirement is a selector that
542
contains values, a key, and an operator that relates the key
543
and values.
544
properties:
545
key:
546
description: key is the label key that the selector applies
547
to.
548
type: string
549
operator:
550
description: operator represents a key's relationship to
551
a set of values. Valid operators are In, NotIn, Exists
552
and DoesNotExist.
553
type: string
554
values:
555
description: values is an array of string values. If the
556
operator is In or NotIn, the values array must be non-empty.
557
If the operator is Exists or DoesNotExist, the values
558
array must be empty. This array is replaced during a strategic
559
merge patch.
560
items:
561
type: string
562
type: array
563
required:
564
- key
565
- operator
566
type: object
567
type: array
568
matchLabels:
569
additionalProperties:
570
type: string
571
description: matchLabels is a map of {key,value} pairs. A single
572
{key,value} in the matchLabels map is equivalent to an element
573
of matchExpressions, whose key field is "key", the operator
574
is "In", and the values array contains only "value". The requirements
575
are ANDed.
576
type: object
577
type: object
578
x-kubernetes-map-type: atomic
579
required:
580
- selector
581
type: object
582
type: object
583
served: true
584
storage: true
585
586