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
**Description:**
- Adds connector and summing logic
- Adds testing of traces and spans summing
Note: testing and test data makes up the bulk of the lines in this PR
**Link to tracking Issue:** 32669
**Testing:**
- condition, attribute, default attribute, multiple condition, multiple
attributes, multiple metrics for traces / spans telemetry types
**Documentation:** No new docs
---------
Co-authored-by: Antoine Toulme <[email protected]>
Copy file name to clipboardExpand all lines: connector/sumconnector/README.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -27,12 +27,12 @@ The `sum` connector can be used to sum attribute values from spans, span events,
27
27
28
28
If you are not already familiar with connectors, you may find it helpful to first visit the [Connectors README](https://github.com/open-telemetry/opentelemetry-collector/blob/main/connector/README.md).
29
29
30
-
### Configuration
31
-
32
-
#### Basic configuration
30
+
### Basic configuration
33
31
34
32
This configuration will sum numerical values found within the attribute `attribute.with.numerical.value` of any log telemetry routed to the connector. It will then output a metric time series with the name `my.example.metric.name` with those summed values.
35
33
34
+
Note: Values found within an attribute will be converted into a float regardless of their original type before being summed and output as a metric value. Non-convertible strings will be dropped and not included.
35
+
36
36
```yaml
37
37
receivers:
38
38
foo:
@@ -58,15 +58,15 @@ service:
58
58
59
59
The sum connector has three required configuration settings and numerous optional settings
60
60
61
-
- Telemetry type: Nested below the `sum:` connector declaration. Declared as `logs:` in the [Basic Example](#basic-configuration).
61
+
- Telemetry type: Nested below the `sum:` connector declaration. Declared as `logs:` in the [Basic Example](#basic-configuration).
62
62
- Can be any of `spans`, `spanevents`, `metrics`, `datapoints`, or `logs`.
63
63
- Metric name: Nested below the telemetry type; this is the metric name the sum connector will output summed values to. Declared as `my.example.metric.name` in the [Basic Example](#basic-configuration)
64
64
- `source_attribute`: A specific attribute to search for within the source telemetry being fed to the connector. This attribute is where the connector will look for numerical values to sum into the output metric value. Declared as `attribute.with.numerical.value` in the [Basic Example](#basic-configuration)
65
65
66
66
#### Optional Settings
67
67
68
-
- `conditions`: [OTTL syntax](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/ottl/LANGUAGE.md) can be used to provide conditions for processing incoming telemetry. Conditions are ORed together, so if any condition is met the attribute's value will be included in the resulting sum.
69
-
- `attributes`: Declaration of attributes to include. Any of these attributes found will generate a separate sum for each set of unique combination of attribute values and output as its own datapoint in the metric time series.
68
+
- `conditions`: [OTTL syntax](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/ottl/LANGUAGE.md) can be used to provide conditions for processing incoming telemetry. Conditions are ORed together, so if any condition is met the attribute's value will be included in the resulting sum.
69
+
- `attributes`: Declaration of attributes to include. Any of these attributes found will generate a separate sum for each set of unique combination of attribute values and output as its own datapoint in the metric time series.
70
70
- `key`: (required for `attributes`) the attribute name to match against
71
71
- `default_value`: (optional for `attributes`) a default value for the attribute when no matches are found. The `default_value` value can be of type string, integer, or float.
0 commit comments