Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(asset): revamp metric model #105

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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 @@

// 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;

Check failure on line 30 in gotocompany/assets/v1beta2/metric.proto

View workflow job for this annotation

GitHub Actions / validate

Field "5" on message "Metric" changed type from "message" to "bool". See https://developers.google.com/protocol-buffers/docs/proto3#updating for wire compatibility rules.

Check failure on line 30 in gotocompany/assets/v1beta2/metric.proto

View workflow job for this annotation

GitHub Actions / validate

Field "5" on message "Metric" changed type from "message" to "bool". See https://developers.google.com/protocol-buffers/docs/proto3#updating for wire compatibility rules.

// 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
Loading