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
This should result in an "must set severity or event type" error (I thought this was actually already there, but doesn't seem to be the case then)
Tag names should be non-empty.
ID tag values should probably be non-empty, for extra tags, at least not at the moment1.
Footnotes
At the moment, we do something like hostgroup/Server so these don't have a value at the moment so we can't require this at the moment. However, this specific aspect will probably change in the future, see Allow multiple values for tags #217. However, I'm not 100% sure if we want to require that even then or if we want to allow something like boolean flag tags (i.e. present/not present), that could be used for something like production, testing instead of env=production, env=testing. ↩
From what I can tell, the Validate() method only checks the slice length and the upper length of the tag's keys (not values).
func (e *Event) Validate() error {
if len(e.Tags) == 0 {
return fmt.Errorf("invalid event: tags must not be empty")
}
for tag := range e.Tags {
if len(tag) > 255 {
return fmt.Errorf("invalid event: tag %q is too long, at most 255 chars allowed, %d given", tag, len(tag))
}
}
for tag := range e.ExtraTags {
if len(tag) > 255 {
return fmt.Errorf(
"invalid event: extra tag %q is too long, at most 255 chars allowed, %d given", tag, len(tag),
)
}
}
...
The process-event API could use stricter validation. Here's what I mean:
Ok good so far, but what about:
Resulting in:
The text was updated successfully, but these errors were encountered: