Protocol Documentation

June 27, 2022 · View on GitHub

Table of Contents

Top

dropsonde-protocol/events/envelope.proto

Envelope

Envelope wraps an Event and adds metadata.

FieldTypeLabelDescription
originstringrequiredUnique description of the origin of this event.
eventTypeEnvelope.EventTyperequiredType of wrapped event. Only the optional field corresponding to the value of eventType should be set.
timestampint64optionalUNIX timestamp (in nanoseconds) event was wrapped in this Envelope.
deploymentstringoptionalDeployment name (used to uniquely identify source).
jobstringoptionalJob name (used to uniquely identify source).
indexstringoptionalIndex of job (used to uniquely identify source).
ipstringoptionalIP address (used to uniquely identify source).
tagsEnvelope.TagsEntryrepeatedkey/value tags to include additional identifying information.
httpStartStopHttpStartStopoptional
logMessageLogMessageoptional
valueMetricValueMetricoptional
counterEventCounterEventoptional
errorErroroptional
containerMetricContainerMetricoptional

Envelope.TagsEntry

FieldTypeLabelDescription
keystringoptional
valuestringoptional

Envelope.EventType

Type of the wrapped event.

NameNumberDescription
HttpStartStop4
LogMessage5
ValueMetric6
CounterEvent7
Error8
ContainerMetric9

Top

dropsonde-protocol/events/error.proto

Error

An Error event represents an error in the originating process.

FieldTypeLabelDescription
sourcestringrequiredSource of the error. This may or may not be the same as the Origin in the envelope.
codeint32requiredNumeric error code. This is provided for programmatic responses to the error.
messagestringrequiredError description (preferably human-readable).

Top

dropsonde-protocol/events/http.proto

HttpStartStop

An HttpStartStop event represents the whole lifecycle of an HTTP request.

FieldTypeLabelDescription
startTimestampint64requiredUNIX timestamp (in nanoseconds) when the request was sent (by a client) or received (by a server).
stopTimestampint64requiredUNIX timestamp (in nanoseconds) when the request was received.
requestIdUUIDrequiredID for tracking lifecycle of request.
peerTypePeerTyperequiredRole of the emitting process in the request cycle.
methodMethodrequiredMethod of the request.
uristringrequiredDestination of the request.
remoteAddressstringrequiredRemote address of the request. (For a server, this should be the origin of the request.)
userAgentstringrequiredContents of the UserAgent header on the request.
statusCodeint32requiredStatus code returned with the response to the request.
contentLengthint64requiredLength of response (bytes).
applicationIdUUIDoptionalIf this request was made in relation to an appliciation, this field should track that application's ID.
instanceIndexint32optionalIndex of the application instance.
instanceIdstringoptionalID of the application instance.
forwardedstringrepeatedThis contains http forwarded-for [x-forwarded-for] header from the request.

Method

HTTP method.

NameNumberDescription
GET1
POST2
PUT3
DELETE4
HEAD5
ACL6
BASELINE_CONTROL7
BIND8
CHECKIN9
CHECKOUT10
CONNECT11
COPY12
DEBUG13
LABEL14
LINK15
LOCK16
MERGE17
MKACTIVITY18
MKCALENDAR19
MKCOL20
MKREDIRECTREF21
MKWORKSPACE22
MOVE23
OPTIONS24
ORDERPATCH25
PATCH26
PRI27
PROPFIND28
PROPPATCH29
REBIND30
REPORT31
SEARCH32
SHOWMETHOD33
SPACEJUMP34
TEXTSEARCH35
TRACE36
TRACK37
UNBIND38
UNCHECKOUT39
UNLINK40
UNLOCK41
UPDATE42
UPDATEREDIRECTREF43
VERSION_CONTROL44

PeerType

Type of peer handling request.

NameNumberDescription
Client1Request is made by this process.
Server2Request is received by this process.

Top

dropsonde-protocol/events/log.proto

LogMessage

A LogMessage contains a "log line" and associated metadata.

FieldTypeLabelDescription
messagebytesrequiredBytes of the log message. (Note that it is not required to be a single line.)
message_typeLogMessage.MessageTyperequiredType of the message (OUT or ERR).
timestampint64requiredUNIX timestamp (in nanoseconds) when the log was written.
app_idstringoptionalApplication that emitted the message (or to which the application is related).
source_typestringoptionalSource of the message. For Cloud Foundry, this can be "APP", "RTR", "DEA", "STG", etc.
source_instancestringoptionalInstance that emitted the message.

LogMessage.MessageType

MessageType stores the destination of the message (corresponding to STDOUT or STDERR).

NameNumberDescription
OUT1
ERR2

Top

dropsonde-protocol/events/metric.proto

ContainerMetric

A ContainerMetric records resource usage of an app in a container.

FieldTypeLabelDescription
applicationIdstringrequiredID of the contained application.
instanceIndexint32requiredInstance index of the contained application. (This, with applicationId, should uniquely identify a container.)
cpuPercentagedoublerequiredCPU based on number of cores.
memoryBytesuint64requiredBytes of memory used.
diskBytesuint64requiredBytes of disk used.
memoryBytesQuotauint64optionalMaximum bytes of memory allocated to container.
diskBytesQuotauint64optionalMaximum bytes of disk allocated to container.

CounterEvent

A CounterEvent represents the increment of a counter. It contains only the change in the value; it is the responsibility of downstream consumers to maintain the value of the counter.

FieldTypeLabelDescription
namestringrequiredName of the counter. Must be consistent for downstream consumers to associate events semantically.
deltauint64requiredAmount by which to increment the counter.
totaluint64optionalTotal value of the counter. This will be overridden by Metron, which internally tracks the total of each named Counter it receives.

ValueMetric

A ValueMetric indicates the value of a metric at an instant in time.

FieldTypeLabelDescription
namestringrequiredName of the metric. Must be consistent for downstream consumers to associate events semantically.
valuedoublerequiredValue at the time of event emission.
unitstringrequiredUnit of the metric. Please see http://metrics20.org/spec/#units for ideas; SI units/prefixes are recommended where applicable. Should be consistent for the life of the metric (consumers are expected to report, but not interpret, prefixes).

Top

dropsonde-protocol/events/uuid.proto

UUID

Type representing a 128-bit UUID.

The bytes of the UUID should be packed in little-endian byte (not bit) order. For example, the UUID f47ac10b-58cc-4372-a567-0e02b2c3d479 should be encoded as UUID{ low: 0x7243cc580bc17af4, high: 0x79d4c3b2020e67a5 }

FieldTypeLabelDescription
lowuint64required
highuint64required

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2282^{28}.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2562^{56}.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)