syntax = "proto3";

package com.newrelic.trace.v1;

service IngestService {
  // Accepts a stream of Span messages, and returns an irregular stream of
  // RecordStatus messages.
  rpc RecordSpan(stream Span) returns (stream RecordStatus) {}
}

message Span {
  string trace_id = 1;
  map<string, AttributeValue> intrinsics = 2;
  map<string, AttributeValue> user_attributes = 3;
  map<string, AttributeValue> agent_attributes = 4;
}

message AttributeValue {
  oneof value {
    string string_value = 1;
    bool bool_value = 2;
    int64 int_value = 3;
    double double_value = 4;
  }
}

message RecordStatus {
  uint64 messages_seen = 1;
}
