Provide Details on Label Filtering/Custom Labels (#13745)
* Provide Details on Label Filtering/Custom Labels Adding documentation for the new Chart Label Filtering feature and custom labels for collectors. * Add screenshots to label filtering * Update docs/dashboard/interact-charts.mdx Co-authored-by: Hugo Valente <82235632+hugovalente-pm@users.noreply.github.com> Co-authored-by: Hugo Valente <82235632+hugovalente-pm@users.noreply.github.com>
DShreve2 committed
Sep 30, 2022 at 10:51 UTC
74fc4831bfcee8b87f194b54adc2a9245e207a86
1 file changed
+57
docs/dashboard/interact-charts.mdx
+57
@@ -117,6 +117,63 @@ the resolution to `resolution 1 sec` to see the exact values.
117
Many of the above interactions can also be triggered using the icons on the bottom-right corner of every chart. They
118
are, respectively, `Pan Left`, `Reset`, `Pan Right`, `Zoom In`, and `Zoom Out`.
119
120
+## Chart label filtering
121
+
122
+The chart label filtering feature supports grouping by and filtering each chart based on labels (key/value pairs) applicable to the context and provides fine-grain capability on slicing the data and metrics.
123
+
124
+All metrics collected get "tagged" with labels and values, thus providing a powerful way of slicing and visualizing all metrics related to the infrastructure.
125
+
126
+The chart label filtering is currently enabled on:
127
+
128
+- All charts on the **Overview** tab
129
+- Custom dashboards
130
+
131
+
132
+
133
+
134
+The top panel on each chart displays the various filters and grouping options selected on the specific chart. These filters are specific for each chart and need to be manually configured on each chart.
135
+
136
+Additionally, the charts can be saved to a custom dashboard, new or existing, with the selected filters from the overview screen.
137
+
138
+
139
+
140
+## Custom labels for Collectors
141
+
142
+In addition to the default labels associated with a collector and metrics context (you can identify them by seeing which ones have an underscore as a prefix), there is now a new feature enabled to create custom labels. These custom labels may be needed to group your jobs or instances into various categories.
143
+
144
+These custom labels can be configured within your go.d plugins by simply associating a label key/value pair, as in the following eaxmple.
145
+
146
+```conf
147
+jobs:
148
+ - name: example_1
149
+ someOption: someValue
150
+ labels:
151
+ label1: value1
152
+ label2: value2
153
+ - name: example_2
154
+ someOption: someValue
155
+ labels:
156
+ label3: value3
157
+ label4: value4
158
+```
159
+
160
+For instance, you may be running multiple Postgres database instances within an infrastructure. Some of these may be associated with testing environments, some with staging and some with production environments. You can now associate each Postgres job / instance with a custom label. The “group by” and filtering options will then allow you to associate individual jobs by specific labels.
161
+
162
+```conf
163
+jobs:
164
+ - name: local
165
+ dsn: 'postgres://postgres:postgres@127.0.0.1:5432/postgres'
166
+ collect_databases_matching: '*'
167
+ labels:
168
+ instance_type: production
169
+ ```
170
+ 
171
+ 
172
+
173
+### Future Work
174
+
175
+We already have [configurable host labels](https://learn.netdata.cloud/guides/using-host-labels) as well, which currently can’t be used to filter or group your metrics. We intend to provide the same capabilities described here with host labels, among other capabilities on other areas of the app as well
176
+
177
## What's next?
178
179
We recommend you read up on the differences between [chart dimensions, contexts, and