syntax = "proto3"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; package pb; // protoc --gogofaster_out=. -I $GOPATH/src -I . stats.proto // StatsPayload is the payload used to send stats from the agent to the backend. message StatsPayload { string agentHostname = 1; string agentEnv = 2; repeated ClientStatsPayload stats = 3 [(gogoproto.nullable) = false]; string agentVersion = 4; bool clientComputed = 5; } // ClientStatsPayload is the first layer of span stats aggregation. It is also // the payload sent by tracers to the agent when stats in tracer are enabled. message ClientStatsPayload { // Hostname is the tracer hostname. It's extracted from spans with "_dd.hostname" meta // or set by tracer stats payload when hostname reporting is enabled. string hostname = 1; string env = 2; // env tag set on spans or in the tracers, used for aggregation string version = 3; // version tag set on spans or in the tracers, used for aggregation repeated ClientStatsBucket stats = 4 [(gogoproto.nullable) = false]; string lang = 5; // informative field not used for aggregation string tracerVersion = 6; // informative field not used for aggregation string runtimeID = 7; // used on stats payloads sent by the tracer to identify uniquely a message uint64 sequence = 8; // used on stats payloads sent by the tracer to identify uniquely a message // AgentAggregation is set by the agent on tracer payloads modified by the agent aggregation layer // characterizes counts only and distributions only payloads string agentAggregation = 9; // Service is the main service of the tracer. // It is part of unified tagging: https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging string service = 10; // ContainerID specifies the origin container ID. It is meant to be populated by the client and may // be enhanced by the agent to ensure it is unique. string containerID = 11; // Tags specifies a set of tags obtained from the orchestrator (where applicable) using the specified containerID. // This field should be left empty by the client. It only applies to some specific environment. repeated string tags = 12; } // ClientStatsBucket is a time bucket containing aggregated stats. message ClientStatsBucket { uint64 start = 1; // bucket start in nanoseconds uint64 duration = 2; // bucket duration in nanoseconds repeated ClientGroupedStats stats = 3 [(gogoproto.nullable) = false]; // AgentTimeShift is the shift applied by the agent stats aggregator on bucket start // when the received bucket start is outside of the agent aggregation window int64 agentTimeShift = 4; } // ClientGroupedStats aggregate stats on spans grouped by service, name, resource, status_code, type message ClientGroupedStats { string service = 1; string name = 2; string resource = 3; uint32 HTTP_status_code = 4; string type = 5; string DB_type = 6; // db_type might be used in the future to help in the obfuscation step uint64 hits = 7; // count of all spans aggregated in the groupedstats uint64 errors = 8; // count of error spans aggregated in the groupedstats uint64 duration = 9; // total duration in nanoseconds of spans aggregated in the bucket bytes okSummary = 10; // ddsketch summary of ok spans latencies encoded in protobuf bytes errorSummary = 11; // ddsketch summary of error spans latencies encoded in protobuf bool synthetics = 12; // set to true on spans generated by synthetics traffic uint64 topLevelHits = 13; // count of top level spans aggregated in the groupedstats string peer_service = 14; // name of the remote service that the `service` communicated with string span_kind = 15; // value of the span.kind tag on the span }