Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package protocol; | 5 package protocol; |
| 6 | 6 |
| 7 import "log.proto"; | 7 import "log.proto"; |
| 8 import "types.proto"; | 8 import "types.proto"; |
| 9 | 9 |
| 10 /* | 10 /* |
| 11 * ButlerMetadata appears as a frame at the beginning of Butler published data | |
| 12 * to describe the remainder of the contents. | |
| 13 */ | |
| 14 message ButlerMetadata { | |
| 15 /* | |
| 16 * This enumerates the possible contents of published Butler data. | |
| 17 */ | |
| 18 enum ContentType { | |
| 19 /* The published data is a ButlerLogBundle protobuf message. */ | |
| 20 ButlerLogBundle = 1; | |
| 21 } | |
| 22 /* This is the type of data in the subsequent frame. */ | |
| 23 optional ContentType type = 1; | |
| 24 | |
| 25 /* If true, the content data is compressed. */ | |
| 26 optional bool compressed = 2; | |
| 27 } | |
| 28 | |
| 29 | |
| 30 /* | |
| 11 * A message containing log data in transit from the Butler. | 31 * A message containing log data in transit from the Butler. |
| 12 * | 32 * |
| 13 * The Butler is capable of conserving bandwidth by bundling collected log | 33 * The Butler is capable of conserving bandwidth by bundling collected log |
| 14 * messages together into this protocol buffer. Based on Butler bundling | 34 * messages together into this protocol buffer. Based on Butler bundling |
| 15 * settings, this message can represent anything from a single LogRecord to | 35 * settings, this message can represent anything from a single LogRecord to |
| 16 * multiple LogRecords belonging to several different streams. | 36 * multiple LogRecords belonging to several different streams. |
| 17 * | 37 * |
| 18 * Entries in a Log Bundle are fully self-descriptive: no additional information | 38 * Entries in a Log Bundle are fully self-descriptive: no additional information |
| 19 * is needed to fully associate the contained data with its proper place in | 39 * is needed to fully associate the contained data with its proper place in |
| 20 * the source log stream. | 40 * the source log stream. |
| 21 */ | 41 */ |
| 22 message ButlerLogBundle { | 42 message ButlerLogBundle { |
| 23 /* | 43 /* |
| 24 * String describing the source of this LogBundle. | 44 * String describing the source of this LogBundle. |
| 25 * This is an unstructured field, and is not intended to be parsed. An | 45 * This is an unstructured field, and is not intended to be parsed. An |
| 26 * example would be: "Butler @a33967 (Linux/amd64)". | 46 * example would be: "Butler @a33967 (Linux/amd64)". |
| 27 * | 47 * |
| 28 * This field will be used for debugging and internal accounting. | 48 * This field will be used for debugging and internal accounting. |
| 29 */ | 49 */ |
| 30 optional string source = 1; | 50 optional string source = 1; |
| 31 | 51 |
| 32 /* The timestamp when this bundle was generated. | 52 /* The timestamp when this bundle was generated. |
| 33 * | 53 * |
| 34 * This field will be used for debugging and internal accounting. | 54 * This field will be used for debugging and internal accounting. |
| 35 */ | 55 */ |
| 36 optional Timestamp timestamp = 2; | 56 optional Timestamp timestamp = 2; |
| 37 | 57 |
| 38 /* | 58 /* |
| 59 * The log stream's secret value (required). | |
|
iannucci
2015/08/26 18:33:33
log prefix's
| |
| 60 * | |
| 61 * The secret is generated by the Butler and unique to this specific log | |
| 62 * stream. The Coordinator will record the secret associated with a given | |
| 63 * log Prefix/Stream, but will not share the secret with a client. | |
| 64 * | |
| 65 * The Collector will check the secret prior to ingesting logs. If the | |
| 66 * secret doesn't match the value recorded by the Coordinator, the log | |
| 67 * will be discarded. | |
| 68 * | |
| 69 * This ensures that only the Butler instance that generated the log stream | |
| 70 * can emit log data for that stream. | |
| 71 */ | |
| 72 optional bytes secret = 3; | |
| 73 | |
| 74 /* | |
| 39 * A bundle Entry describes a set of LogEntry messages originating from the | 75 * A bundle Entry describes a set of LogEntry messages originating from the |
| 40 * same log stream. | 76 * same log stream. |
| 41 */ | 77 */ |
| 42 message Entry { | 78 message Entry { |
| 43 /* | 79 /* |
| 44 * The descriptor for this entry's log stream. | 80 * The descriptor for this entry's log stream. |
| 45 * | 81 * |
| 46 * Each LogEntry in the "logs" field is shares this common descriptor. | 82 * Each LogEntry in the "logs" field is shares this common descriptor. |
| 47 */ | 83 */ |
| 48 optional LogStreamDescriptor desc = 1; | 84 optional LogStreamDescriptor desc = 1; |
| 49 | 85 |
| 50 /* | 86 /* |
| 51 * The log stream's secret value (required). | |
| 52 * | |
| 53 * The secret is generated by the Butler and unique to this specific log | |
| 54 * stream. The Coordinator will record the secret associated with a given | |
| 55 * log Prefix/Stream, but will not share the secret with a client. | |
| 56 * | |
| 57 * The Collector will check the secret prior to ingesting logs. If the | |
| 58 * secret doesn't match the value recorded by the Coordinator, the log | |
| 59 * will be discarded. | |
| 60 * | |
| 61 * This ensures that only the Butler instance that generated the log stream | |
| 62 * can emit log data for that stream. | |
| 63 */ | |
| 64 optional bytes secret = 2; | |
| 65 | |
| 66 /* | |
| 67 * Whether this log entry terminates its stream. | 87 * Whether this log entry terminates its stream. |
| 68 * | 88 * |
| 69 * If present and "true", this field declares that this Entry is the last | 89 * If present and "true", this field declares that this Entry is the last |
| 70 * such entry in the stream. This fact is recorded by the Collector and | 90 * such entry in the stream. This fact is recorded by the Collector and |
| 71 * registered with the Coordinator. The largest stream prefix in this Entry | 91 * registered with the Coordinator. The largest stream prefix in this Entry |
| 72 * will be bound the stream's LogEntry records to [0:largest_prefix]. Once | 92 * will be bound the stream's LogEntry records to [0:largest_prefix]. Once |
| 73 * all messages in that range have been received, the log may be archived. | 93 * all messages in that range have been received, the log may be archived. |
| 74 * | 94 * |
| 75 * Further log entries belonging to this stream with stream indices | 95 * Further log entries belonging to this stream with stream indices |
| 76 * exceeding the terminal log's index will be discarded. | 96 * exceeding the terminal log's index will be discarded. |
| 77 */ | 97 */ |
| 78 optional bool terminal = 3; | 98 optional bool terminal = 3; |
| 79 | 99 |
| 80 /* | 100 /* |
| 101 * If terminal is true, this is the terminal stream index; that is, the last | |
| 102 * message index in the stream. | |
| 103 */ | |
| 104 optional uint32 terminal_index = 4; | |
| 105 | |
| 106 /* | |
| 81 * Log entries attached to this record. These must be sequential and in | 107 * Log entries attached to this record. These must be sequential and in |
| 82 * order. | 108 * order. |
| 83 * | 109 * |
| 84 * This is the main log entry content. | 110 * This is the main log entry content. |
| 85 */ | 111 */ |
| 86 repeated protocol.LogEntry logs = 4; | 112 repeated protocol.LogEntry logs = 5; |
| 87 } | 113 } |
| 88 | 114 |
| 89 /** | 115 /** |
| 90 * Each Entry is an individual set of log records for a given log stream. | 116 * Each Entry is an individual set of log records for a given log stream. |
| 91 */ | 117 */ |
| 92 repeated Entry entries = 5; | 118 repeated Entry entries = 4; |
| 93 } | 119 } |
| OLD | NEW |