Skip to content

Commit d181bbc

Browse files
Clarify the use and limits of labels (#312)
Co-authored-by: Joyce Fee <102751339+Feediver1@users.noreply.github.com>
1 parent 0986a4f commit d181bbc

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

modules/configuration/pages/about.adoc

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,95 @@ input:
111111

112112
This is very useful for sharing configuration files across different deployment environments.
113113

114+
== Labels
115+
116+
Labels are unique, user-defined identifiers used throughout Redpanda Connect configurations. They serve two purposes:
117+
118+
- **Reference:** Allow different parts of your pipeline to refer to specific components or resources.
119+
- **Readability:** Make your configuration more understandable for humans, especially in complex deployments.
120+
121+
You can assign labels to most pipeline components, including resources, inputs, outputs, processors, and entire pipelines. Using clear, descriptive labels improves both maintainability and clarity.
122+
123+
Labels are commonly applied to the following components:
124+
125+
=== Resources
126+
127+
Labels identify <<reuse, reusable resources>> such as processors, caches, and rate limiters, making them easy to reference elsewhere in your pipeline.
128+
129+
[source,yaml]
130+
----
131+
processor_resources:
132+
- label: my-transformer # Processor resource label
133+
mapping: 'root = content().uppercase()'
134+
135+
cache_resources:
136+
- label: user-cache # Cache resource label
137+
memory:
138+
default_ttl: 300s
139+
140+
rate_limit_resources:
141+
- label: api-limiter # Rate limiter resource label
142+
local:
143+
count: 100
144+
interval: 1m
145+
----
146+
147+
=== Pipelines (streams mode)
148+
149+
When running in xref:guides:streams_mode/about.adoc[streams mode] with the Streams API, labels serve as pipeline names. This enables you to create and reference pipelines by their label through the API.
150+
151+
[source,bash]
152+
----
153+
# Create a pipeline labeled "data-processor"
154+
curl -X POST http://localhost:4195/streams/data-processor \
155+
-H "Content-Type: application/yaml" \
156+
-d @pipeline-config.yaml
157+
158+
# Reference a pipeline by its label
159+
curl http://localhost:4195/streams/data-processor
160+
----
161+
162+
=== Component labeling for clarity
163+
164+
You can also use labels on inputs, outputs, processors, and other components to improve the human-readability of your configuration and make troubleshooting easier. For example:
165+
166+
[source,yaml]
167+
----
168+
input:
169+
label: ingest_api
170+
http_server: {}
171+
172+
pipeline:
173+
label: user_data_ingest
174+
processors:
175+
- label: sanitize_fields
176+
mapping: 'root = this.trim()'
177+
- resource: my-transformer
178+
----
179+
180+
== Label naming requirements
181+
182+
Labels must meet the following criteria:
183+
184+
* *Length*: 3-128 characters
185+
* *Allowed characters*: Alphanumeric, hyphens, and underscores (`A-Za-z0-9-_`)
186+
* *Case sensitivity*: Labels are case-sensitive
187+
188+
.Example valid labels
189+
----
190+
my-processor
191+
data_transformer_01
192+
UserAnalytics-v2
193+
----
194+
195+
.Example invalid labels
196+
----
197+
ab // Too short (less than 3 characters)
198+
my.processor // Invalid character: period
199+
my processor // Invalid character: space
200+
----
201+
202+
[[reuse]]
114203
== Reusing configuration snippets
115204

116205
ifndef::env-cloud[]

0 commit comments

Comments
 (0)