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
# TODO (https://github.com/open-telemetry/weaver/issues/279): provide other violation properties once weaver supports it.
70
-
description :=sprintf("Attribute definition '%s' has requirement_level set to %s. Only attribute references can set requirement_level.", [attr.id, attr.requirement_level])
70
+
description :=sprintf("Attribute definition '%s' has requirement_level set to %s. Only attribute references can set requirement_level.", [attr.name, attr.requirement_level])
71
71
}
72
72
73
73
# We require attribute definitions to have stability
74
-
deny contains attr_registry_violation(description, group.id, attr.id) if {
74
+
deny contains attr_registry_violation(description, group.id, attr.name) if {
75
75
group := input.groups[_]
76
76
attr := group.attributes[_]
77
77
not attr.stability
78
-
description :=sprintf("Attribute definition '%s' does not contain stability field. All attribute definitions must include stability level.", [attr.id])
78
+
description :=sprintf("Attribute definition '%s' does not contain stability field. All attribute definitions must include stability level.", [attr.name])
79
79
}
80
80
81
81
# We require span, metrics, events, resources definitions to have stability
collisions := [n | n := attr.type.members[_].id; n == member.id ]
101
101
count(collisions) >1
102
102
103
-
description :=sprintf("Member with id '%s' is already defined on the attribute '%s' in the group '%s'. Member id must be unique.", [member.id, attr.id, group.id])
103
+
description :=sprintf("Member with id '%s' is already defined on the attribute '%s' in the group '%s'. Member id must be unique.", [member.id, attr.name, group.id])
104
104
}
105
105
106
106
# check that member values do not collide within the same attribute
107
-
deny contains attr_registry_violation(description, group.id, attr.id) if {
107
+
deny contains attr_registry_violation(description, group.id, attr.name) if {
description :=sprintf("Member with value '%s' (id '%s') is already defined on the attribute '%s' in the group '%s'. Member value must be unique.", [member.value, member.id, attr.id, group.id])
121
+
description :=sprintf("Member with value '%s' (id '%s') is already defined on the attribute '%s' in the group '%s'. Member value must be unique.", [member.value, member.id, attr.name, group.id])
122
122
}
123
123
124
124
# check that member const names do not collide within the same attribute
125
-
deny contains attr_registry_violation(description, group.id, attr.id) if {
125
+
deny contains attr_registry_violation(description, group.id, attr.name) if {
description :=sprintf("Member with const name '%s' (id '%s'), is already defined on the attribute '%s' in the group '%s'. Member const names must be unique.", [const_name, member.id, attr.id, group.id])
141
+
description :=sprintf("Member with const name '%s' (id '%s'), is already defined on the attribute '%s' in the group '%s'. Member const names must be unique.", [const_name, member.id, attr.name, group.id])
0 commit comments