Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 20 additions & 22 deletions gotocompany/assets/v1beta2/metric.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,26 @@ option java_package = "com.gotocompany.assets";

// A metric is a timeseries aggregation over a table that supports zero or more dimensions.
message Metric {
// Namespace of the metric. Something like `{project}-{model}` for dbt and
// `schema` for Cube.
string namespace = 1;

// The field being used to calculate a metric.
string field_name = 2;

// Type of the evaluated metric. ex: count_distinct, average etc.
string measure_type = 3;

// Optional: The query, possibly in SQL representation, with filters and aggregations.
string query = 4;

// Optional: List of attributes the metric has. This could include the
// following:
// - time_grains[repeated string]: One or more "grains" at which the metric
// can be evaluated. Ex: [day, week, month].
// - dimensions[repeated string]: A list of dimensions to group or filter the
// metric by. Ex: [plan, country].
// - filters[repeated map<string, string>]: Predicates for the metric. Ex:
// [{"field": "is_paying", "operator": "is", "value": "true"}].
google.protobuf.Struct attributes = 5;
// Metric's definition. Can be in a text describing the metrics or a formula.
string definition = 1;

// A query on how to calculate and generate the metric.
// Metric is not defined by where it is stored, but instead on how it is generated.
string query = 2;

// Team owning the metric's definition.
string team = 3;

// Optional: This field can be utilised to group multiple metrics.
// We can utilise this field to group the following two different metrics "GMV Product A" and "GMV Product B".
// In the example above, this "group" field can be "GMV" for both metrics.
string group = 4;

// Optional: This field can be used as a flag for metric verification
bool is_verified = 5;

// List of attributes the model has.
google.protobuf.Struct attributes = 10;

// The timestamp of the metric's creation.
google.protobuf.Timestamp create_time = 101;
Expand Down