mirror of
https://github.com/prometheus/alertmanager
synced 2025-03-11 06:07:46 +00:00
This commit adds an implementation of a silence storage that can share store and modify silences, share state via a mesh network, write and load snapshots, and be dynamically queried. All data formats are based on protocol buffers.
58 lines
1.5 KiB
Protocol Buffer
58 lines
1.5 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package silencepb;
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
// Matcher specifies a rule, which can match or set of labels or not.
|
|
message Matcher {
|
|
// Type specifies how the given name and pattern are matched
|
|
// against a label set.
|
|
enum Type {
|
|
EQUAL = 0;
|
|
REGEXP = 1;
|
|
};
|
|
Type type = 1;
|
|
|
|
// The label name in a label set to against which the matcher
|
|
// checks the pattern.
|
|
string name = 2;
|
|
// The pattern being checked according to the matcher's type.
|
|
string pattern = 3;
|
|
}
|
|
|
|
// A comment can be attached to a silence.
|
|
message Comment {
|
|
string author = 1;
|
|
string comment = 2;
|
|
google.protobuf.Timestamp timestamp = 3;
|
|
}
|
|
|
|
// Silence specifies an object that ignores alerts based
|
|
// on a set of matchers during a given time frame.
|
|
message Silence {
|
|
// A globally unique identifier.
|
|
string id = 1;
|
|
|
|
// A set of matchers all of which have to be true for a silence
|
|
// to affect a given label set.
|
|
repeated Matcher matchers = 2;
|
|
|
|
// The time range during which the silence is active.
|
|
google.protobuf.Timestamp starts_at = 3;
|
|
google.protobuf.Timestamp ends_at = 4;
|
|
|
|
// The last motification made to the silence.
|
|
google.protobuf.Timestamp updated_at = 5;
|
|
|
|
// A set of comments made on the silence.
|
|
repeated Comment comments = 7;
|
|
}
|
|
|
|
// MeshSilence wraps a regular silence with an expiration timestamp
|
|
// after which the silence may be garbage collected.
|
|
message MeshSilence {
|
|
Silence silence = 1;
|
|
google.protobuf.Timestamp expires_at = 2;
|
|
}
|