| Tim Windelschmidt | 8814f52 | 2024-05-08 00:41:13 +0200 | [diff] [blame] | 1 | // Copyright 2020 The Monogon Project Authors. |
| 2 | // |
| 3 | // SPDX-License-Identifier: Apache-2.0 |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | // you may not use this file except in compliance with the License. |
| 7 | // You may obtain a copy of the License at |
| 8 | // |
| 9 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | // |
| 11 | // Unless required by applicable law or agreed to in writing, software |
| 12 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | // See the License for the specific language governing permissions and |
| 15 | // limitations under the License. |
| 16 | |
| 17 | syntax = "proto3"; |
| Tim Windelschmidt | 2f9f624 | 2025-01-11 08:25:54 +0100 | [diff] [blame] | 18 | package osbase.logtree.proto; |
| Tim Windelschmidt | 9f21f53 | 2024-05-07 15:14:20 +0200 | [diff] [blame] | 19 | option go_package = "source.monogon.dev/osbase/logtree/proto"; |
| Tim Windelschmidt | 8814f52 | 2024-05-08 00:41:13 +0200 | [diff] [blame] | 20 | |
| 21 | import "google/protobuf/timestamp.proto"; |
| 22 | |
| Tim Windelschmidt | 9f21f53 | 2024-05-07 15:14:20 +0200 | [diff] [blame] | 23 | // Severity level corresponding to //osbase/logtree.Severity. |
| Tim Windelschmidt | 8814f52 | 2024-05-08 00:41:13 +0200 | [diff] [blame] | 24 | enum LeveledLogSeverity { |
| 25 | INVALID = 0; |
| 26 | INFO = 1; |
| 27 | WARNING = 2; |
| 28 | ERROR = 3; |
| 29 | FATAL = 4; |
| 30 | } |
| 31 | |
| Tim Windelschmidt | 9f21f53 | 2024-05-07 15:14:20 +0200 | [diff] [blame] | 32 | // LogEntry corresponding to logtree.LogEntry in //osbase/logtree. |
| Tim Windelschmidt | 8814f52 | 2024-05-08 00:41:13 +0200 | [diff] [blame] | 33 | message LogEntry { |
| 34 | // A leveled log entry emitted from a compatible system, eg. Metorpolis code |
| 35 | // or a klog-parsed line. |
| 36 | message Leveled { |
| 37 | repeated string lines = 1; |
| 38 | google.protobuf.Timestamp timestamp = 2; |
| 39 | LeveledLogSeverity severity = 3; |
| 40 | // Source of the error, expressed as file:line. |
| 41 | string location = 4; |
| 42 | } |
| 43 | // Raw log entry, captured from an external system without parting. Might |
| 44 | // contain some timestamp/level/origin information embedded in data. Data |
| 45 | // contained within should be treated as unsanitized external data. |
| 46 | message Raw { |
| 47 | string data = 1; |
| 48 | // Original length of line, set if data was truncated. |
| 49 | int64 original_length = 2; |
| 50 | } |
| 51 | |
| 52 | // Origin DN (Distinguished Name), a unique identifier which is provided by |
| 53 | // the supervisor system. |
| 54 | string dn = 1; |
| 55 | oneof kind { |
| 56 | Leveled leveled = 2; |
| 57 | Raw raw = 3; |
| 58 | } |
| 59 | } |