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
Add validation and documentation for compositeName in entity synthesis (#2337)
* Add validation and documentation for compositeName in entity synthesis
* Add validation and documentation for compositeName in entity synthesis
---------
Co-authored-by: nr-cmorenoin <[email protected]>
| name | String | Yes | The attribute to use for the entity name. |
29
+
| compositeName | Object | No | Set of attributes and literals that will be concatenated to form the entity name. When this one is used name is not required. |
30
+
| identifier| String| Yes | Telemetry attribute to use as the entity identifier. |
31
+
| compositeIdentifier| String| No | Set of attributes that will identify the telemetry. When this one is used identifier is not required. |
32
+
| encodeIdentifierInGUID | Boolean | No | If true, the identifier value will be hashed to respect the [GUID limits][guid_spec]. Defaults to `false`. |
33
+
| conditions | List | No | The list of conditions to apply in the data point to match the rule. Defaults to an empty list. |
34
+
| tags | List | No | The list of attributes to copy as entity tags if the rule matches. Defaults to an empty list. |
35
+
36
+
### Name
37
+
38
+
The attribute from the telemetry to be used as the name of the entity. Either this or `compositeName` must be defined.
39
+
The name does not need to be unique, different entities with the same entityType in the same account can have the same name, as long as their identifiers are different, they will be different entities.
40
+
41
+
#### Composite name
42
+
43
+
In some cases the name of the entity is not defined by a single attribute, but rather a combination of multiple attributes and literals.
44
+
In these cases, `compositeName` can be used to define how these attributes and literals are combined to form the name.
45
+
46
+
The `compositeName` is formed from `fragments`, which is a non-empty list of objects, containing only one of the following properties:
47
+
- `attribute`, which represents an attribute name that must be always present in the telemetry. The value of the given attribute in the telemetry data point will be added to the name.
48
+
- `value`, that is a literal value to be concatenated to the name. It has to be delimited by double quotes.
49
+
50
+
The `attribute`s and `value`s will be concatenated in the order they are defined in the list to conform the final entity name.
51
+
52
+
```yaml
53
+
synthesis:
54
+
rules:
55
+
- identifier: hostname
56
+
compositeName:
57
+
fragments:
58
+
- value: "ks-broker: "
59
+
- attribute: kafka.broker.name
60
+
- value: " ("
61
+
- attribute: kafka.cluster.name
62
+
- value: ")"
63
+
# Other rule properties...
64
+
```
65
+
66
+
If we take as an example the following data point, and apply the above synthesis rule:
67
+
68
+
```json
69
+
{
70
+
"kafka.broker.name": "broker-1",
71
+
"kafka.cluster.name": "my-cluster"
72
+
}
73
+
```
34
74
75
+
The `name` of the entity will be synthesized as: `ks-broker: broker-1 (my-cluster)`
0 commit comments