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
Copy file name to clipboardExpand all lines: content/en/ninja-workshops/3-opentelemetry-collector-workshops/2-advanced-collector/9-sum-count/9-1-count-test.md
Include the Count Connector in the connectors section of your configuration and define the metrics counters:
42
+
Include the Count Connector in the connector's section of your configuration and define the metrics counters:
43
43
44
44
```yaml
45
+
connectors:
45
46
count:
46
47
logs:
47
48
logs.full.count:
@@ -67,11 +68,60 @@ Include the Count Connector in the connectors section of your configuration and
67
68
- `logs.lotr.count`: Counts logs that contain a quote from a Lord of the Rings movie.
68
69
- `logs.error.count`: Represents a real-world scenario by counting logs with a severity level of ERROR.
69
70
71
+
- **Configure the Count Connector in the pipelines**
72
+
73
+
```yaml
74
+
pipelines:
75
+
traces:
76
+
receivers:
77
+
- otlp
78
+
processors:
79
+
- memory_limiter
80
+
- attributes/update # Update, hash, and remove attributes
81
+
- redaction/redact # Redact sensitive fields using regex
82
+
- resourcedetection
83
+
- resource/add_mode
84
+
- batch
85
+
exporters:
86
+
- debug
87
+
- file
88
+
- otlphttp
89
+
metrics:
90
+
receivers:
91
+
- count
92
+
- otlp
93
+
#- hostmetrics # Host Metrics Receiver
94
+
processors:
95
+
- memory_limiter
96
+
- resourcedetection
97
+
- resource/add_mode
98
+
- batch
99
+
exporters:
100
+
- debug
101
+
- otlphttp
102
+
logs:
103
+
receivers:
104
+
- otlp
105
+
- filelog/quotes
106
+
processors:
107
+
- memory_limiter
108
+
- resourcedetection
109
+
- resource/add_mode
110
+
- transform/logs # Transform logs processor
111
+
- batch
112
+
exporters:
113
+
- count
114
+
- debug
115
+
- otlphttp
116
+
```
117
+
70
118
{{% /notice %}}
71
119
72
-
We count logs based on their attributes. If your log data is stored in the log body instead of attributes, you’ll need to use a Transform processor in your pipeline to extract key/value pairs and add them as attributes.
120
+
We count logs based on their attributes. If your log data is stored in the log body instead of attributes, you’ll need to use a `Transform` processor in your pipeline to extract key/value pairs and add them as attributes.
121
+
122
+
In this workshop, we’ve already added `merge_maps(attributes, cache, "upsert")` in the `07-transform` section. This ensures that all relevant data is included in the log attributes for processing.
73
123
74
-
In this workshop, we’ve already included `merge_maps(attributes, cache, "upsert")` in the Transform section. This ensures that all relevant data is available in the log attributes for processing.
124
+
When selecting fields to create attributes from, be mindful—adding all fields indiscriminately is generally not ideal for production environments. Instead, choose only the fields that are truly necessary to avoid unnecessary data clutter.
0 commit comments