// Copyright (C) 2022 The OKit Authors // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE // OR OTHER DEALINGS IN THE SOFTWARE. syntax = "proto3"; package obkit; option go_package = "code.pitz.tech/mya/okit/pb"; // Duration provides a protocol local implementation of a duration. message Duration { int64 nanos = 1; } // Timestamp provides a protocol local implementation of a timestamp. message Timestamp { int64 seconds = 1; int32 nanos = 2; } // Tag defines a key-value element eligible for indexing. message Tag { string key = 1; oneof value { string string = 5; int64 int64 = 6; double double = 7; bytes bytes = 8; bool bool = 9; Duration duration = 10; Timestamp timestamp = 11; } } // Kind represents the various types of elements that we're collecting. enum Kind { Unknown = 0; Event = 1; Metric = 2; Trace = 3; Log = 4; } // Wire represents a common structure for communicating common observability elements. To help illustrate this, let us // consider the following. // // - An Event is an Entry who's name is set and contains optional tags. // - A Log is an Entry who's value is set to the verbosity of the message. // - A Metric is an Event that has a value associated with the entry. // - A Trace is a Metric whose tags have a specific structure that allow multiple to be correlated. // message Entry { // Timestamp defines when the entry was emit. This system assumes the client clock is accurate enough. Timestamp timestamp = 1; // Scope is used to identify the metric name, log message, or traced function. string scope = 2; // Kind is used to indicate what type of entry this is. Kind kind = 3; // Tags is an optional field that contains a list of metadata associated with the entry. repeated Tag tags = 4; } // ClientInfo is used to capture specific information about the client application that is emitting information. message ClientInfo { // Name is the canonical, simple name of the application (redis, mysql, etc...). string name = 1; // Instance is a unique identifier assigned to the process. This can be a hostname in the case of containers. It could // also be a mac address in the case of physical machines. string instance = 2; } // Packet defines the set of data that is contained within each message sent to the server. message Packet { // Id provides an id for the packet so the server can deduplicate packets of information being sent to them. bytes id = 1; // Client contains information that identifies the emitting client. ClientInfo client = 2; // Entries are processed in batches, allowing local clients to buffer if necessary. repeated Entry entries = 3; }