All Downloads are FREE. Search and download functionalities are using the official Maven repository.

banyandb.v1.banyandb-common.proto Maven / Gradle / Ivy

The newest version!
// Licensed to Apache Software Foundation (ASF) under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Apache Software Foundation (ASF) licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

syntax = "proto3";

option java_package = "org.apache.skywalking.banyandb.common.v1";

package banyandb.common.v1;

import "google/protobuf/timestamp.proto";
import "validate/validate.proto";

enum Catalog {
  CATALOG_UNSPECIFIED = 0;
  CATALOG_STREAM = 1;
  CATALOG_MEASURE = 2;
}

// Metadata is for multi-tenant, multi-model use
message Metadata {
  // group contains a set of options, like retention policy, max
  string group = 1;
  // name of the entity
  string name = 2;
  // id is the unique identifier of the entity
  // if id is not set, the system will generate a unique id
  uint32 id = 3;
  // readonly. create_revision is the revision of last creation on this key.
  int64 create_revision = 4;
  // readonly. mod_revision is the revision of last modification on this key.
  int64 mod_revision = 5;
}

// IntervalRule is a structured duration
message IntervalRule {
  enum Unit {
    UNIT_UNSPECIFIED = 0;
    UNIT_HOUR = 1;
    UNIT_DAY = 2;
  }
  // unit can only be UNIT_HOUR or UNIT_DAY
  Unit unit = 1 [(validate.rules).enum.defined_only = true];
  uint32 num = 2 [(validate.rules).uint32.gt = 0];
}

message ResourceOpts {
  // shard_num is the number of shards
  uint32 shard_num = 1 [(validate.rules).uint32.gt = 0];
  // segment_interval indicates the length of a segment
  IntervalRule segment_interval = 2 [(validate.rules).message.required = true];
  // ttl indicates time to live, how long the data will be cached
  IntervalRule ttl = 3 [(validate.rules).message.required = true];
}

// Group is an internal object for Group management
message Group {
  // metadata define the group's identity
  common.v1.Metadata metadata = 1 [(validate.rules).message.required = true];
  // catalog denotes which type of data the group contains
  common.v1.Catalog catalog = 2;
  // resourceOpts indicates the structure of the underlying kv storage
  ResourceOpts resource_opts = 3;
  // updated_at indicates when resources of the group are updated
  google.protobuf.Timestamp updated_at = 4;
}


// Trace is the top level message of a trace.
message Trace {
  // trace_id is the unique identifier of the trace.
  string trace_id = 1;
  // spans is a list of spans in the trace.
  repeated Span spans = 2;
  // error indicates whether the trace is an error trace.
  bool error = 3;
}

// Span is the basic unit of a trace.
message Span {
  // start_time is the start time of the span.
  google.protobuf.Timestamp start_time = 1;
  // end_time is the end time of the span.
  google.protobuf.Timestamp end_time = 2;
  // error indicates whether the span is an error span.
  bool error = 3;
  // tags is a list of tags of the span.
  repeated Tag tags = 4;
  // message is the message generated by the span.
  string message = 5;
  // children is a list of child spans of the span.
  repeated Span children = 6;
  // duration is the duration of the span.
  int64 duration = 7;
}

// Tag is the key-value pair of a span.
message Tag {
  // key is the key of the tag.
  string key = 1;
  // value is the value of the tag.
  string value = 2;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy