Skip to content

Commit a482b09

Browse files
Add configuration schemas for various components in the receiver category
1 parent fa5f4ee commit a482b09

File tree

21 files changed

+740
-2
lines changed

21 files changed

+740
-2
lines changed

.schemagen.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ mappings:
1111
go.opentelemetry.io/collector/component:
1212
ID:
1313
schemaType: string
14+
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator:
15+
Config:
16+
schemaType: ""
1417
golang.org/x/time/rate:
1518
Limit:
1619
schemaType: number

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ generate-gh-issue-templates:
702702
SCHEMA_DIRS := $(shell find $(CURDIR) -path "*testdata*" -prune -o -name "config.schema.yaml" -exec dirname {} \; | sort -u)
703703

704704
.PHONY: generate-schemas
705-
generate-schemas:
705+
generate-schemas: $(SCHEMAGEN)
706706
@$(foreach dir,$(SCHEMA_DIRS), $(SCHEMAGEN) $(dir) -o $(dir);)
707707

708708
.PHONY: checks
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
$defs:
2+
config:
3+
description: Config defines configuration for retrying batches in case of receiving a retryable error from a downstream consumer. If the retryable error doesn't provide a delay, exponential backoff is applied.
4+
type: object
5+
properties:
6+
enabled:
7+
description: Enabled indicates whether to not retry sending logs in case of receiving a retryable error from a downstream consumer. Default is false.
8+
type: boolean
9+
initial_interval:
10+
description: InitialInterval the time to wait after the first failure before retrying. Default value is 1 second.
11+
type: string
12+
format: duration
13+
max_elapsed_time:
14+
description: MaxElapsedTime is the maximum amount of time (including retries) spent trying to send a logs batch to a downstream consumer. Once this value is reached, the data is discarded. It never stops if MaxElapsedTime == 0. Default value is 5 minutes.
15+
type: string
16+
format: duration
17+
max_interval:
18+
description: MaxInterval is the upper bound on backoff interval. Once this value is reached the delay between consecutive retries will always be `MaxInterval`. Default value is 30 seconds.
19+
type: string
20+
format: duration
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$defs:
2+
base_config:
3+
description: BaseConfig is the common configuration of a stanza-based receiver
4+
type: object
5+
properties:
6+
operators:
7+
type: array
8+
items:
9+
x-customType: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator.Config
10+
retry_on_failure:
11+
$ref: github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/consumerretry.config
12+
storage:
13+
x-pointer: true
14+
type: string
15+
x-customType: go.opentelemetry.io/collector/component.ID
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
$defs:
2+
severity:
3+
description: Severity indicates the seriousness of a log entry
4+
type: integer
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
$defs:
2+
attributer_config:
3+
description: AttributerConfig is the configuration of a attributer
4+
type: object
5+
properties:
6+
attributes:
7+
type: object
8+
additionalProperties:
9+
$ref: expr_string_config
10+
basic_config:
11+
description: BasicConfig provides a basic implemention for an operator config.
12+
type: object
13+
properties:
14+
id:
15+
type: string
16+
type:
17+
type: string
18+
byte_size:
19+
type: integer
20+
x-customType: int64
21+
expr_string_config:
22+
description: ExprStringConfig is a string that represents an expression
23+
type: string
24+
identifier_config:
25+
description: IdentifierConfig is the configuration of a resource identifier
26+
type: object
27+
properties:
28+
resource:
29+
type: object
30+
additionalProperties:
31+
$ref: expr_string_config
32+
input_config:
33+
description: InputConfig provides a basic implementation of an input operator config.
34+
type: object
35+
allOf:
36+
- $ref: attributer_config
37+
- $ref: identifier_config
38+
- $ref: writer_config
39+
output_config:
40+
description: OutputConfig provides a basic implementation of an output operator config.
41+
type: object
42+
allOf:
43+
- $ref: basic_config
44+
parser_config:
45+
description: ParserConfig provides the basic implementation of a parser config.
46+
type: object
47+
properties:
48+
body:
49+
x-pointer: true
50+
$ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field
51+
parse_from:
52+
$ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field
53+
parse_to:
54+
$ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.rootable_field
55+
scope_name:
56+
x-pointer: true
57+
$ref: scope_name_parser
58+
severity:
59+
x-pointer: true
60+
$ref: severity_config
61+
timestamp:
62+
x-pointer: true
63+
$ref: time_parser
64+
trace:
65+
x-pointer: true
66+
$ref: trace_parser
67+
allOf:
68+
- $ref: transformer_config
69+
scope_name_parser:
70+
description: ScopeNameParser is a helper that parses severity onto an entry.
71+
type: object
72+
properties:
73+
parse_from:
74+
$ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field
75+
severity_config:
76+
description: SeverityConfig allows users to specify how to parse a severity from a field.
77+
type: object
78+
properties:
79+
mapping:
80+
type: object
81+
additionalProperties:
82+
x-customType: any
83+
overwrite_text:
84+
type: boolean
85+
parse_from:
86+
x-pointer: true
87+
$ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field
88+
preset:
89+
type: string
90+
span_id_config:
91+
type: object
92+
properties:
93+
parse_from:
94+
x-pointer: true
95+
$ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field
96+
time_parser:
97+
description: TimeParser is a helper that parses time onto an entry.
98+
type: object
99+
properties:
100+
layout:
101+
type: string
102+
layout_type:
103+
type: string
104+
location:
105+
type: string
106+
parse_from:
107+
x-pointer: true
108+
$ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field
109+
trace_flags_config:
110+
type: object
111+
properties:
112+
parse_from:
113+
x-pointer: true
114+
$ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field
115+
trace_id_config:
116+
type: object
117+
properties:
118+
parse_from:
119+
x-pointer: true
120+
$ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field
121+
trace_parser:
122+
description: TraceParser is a helper that parses trace spans (and flags) onto an entry.
123+
type: object
124+
properties:
125+
span_id:
126+
x-pointer: true
127+
$ref: span_id_config
128+
trace_flags:
129+
x-pointer: true
130+
$ref: trace_flags_config
131+
trace_id:
132+
x-pointer: true
133+
$ref: trace_id_config
134+
transformer_config:
135+
description: TransformerConfig provides a basic implementation of a transformer config.
136+
type: object
137+
properties:
138+
if:
139+
type: string
140+
on_error:
141+
type: string
142+
allOf:
143+
- $ref: writer_config
144+
writer_config:
145+
description: WriterConfig is the configuration of a writer operator.
146+
type: object
147+
properties:
148+
output:
149+
type: array
150+
items:
151+
type: string
152+
allOf:
153+
- $ref: basic_config
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
$defs:
2+
config:
3+
description: Config is the configuration of a journald input operator
4+
type: object
5+
properties:
6+
all:
7+
type: boolean
8+
convert_message_bytes:
9+
type: boolean
10+
directory:
11+
x-pointer: true
12+
type: string
13+
dmesg:
14+
type: boolean
15+
files:
16+
type: array
17+
items:
18+
type: string
19+
grep:
20+
type: string
21+
identifiers:
22+
type: array
23+
items:
24+
type: string
25+
journalctl_path:
26+
type: string
27+
matches:
28+
type: array
29+
items:
30+
$ref: match_config
31+
merge:
32+
type: boolean
33+
namespace:
34+
type: string
35+
priority:
36+
type: string
37+
root_path:
38+
type: string
39+
start_at:
40+
type: string
41+
units:
42+
type: array
43+
items:
44+
type: string
45+
allOf:
46+
- $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper.input_config

pkg/stanza/operator/input/journald/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type: journald
22

33
status:
44
disable_codecov_badge: true
5-
class: pkg/stanza/operator/input
5+
class: pkg
66
stability:
77
alpha: [logs]
88
codeowners:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
type: object
2+
allOf:
3+
- $ref: go.opentelemetry.io/collector/config/confighttp.client_config
4+
- $ref: go.opentelemetry.io/collector/scraper/scraperhelper.controller_config
5+
- $ref: ./internal/metadata.metrics_builder_config

0 commit comments

Comments
 (0)