Skip to content
1 change: 1 addition & 0 deletions workflows/go/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ package workflows
//go:generate protoc --proto_path=../ --go_out=./ --go_opt=module=github.com/smartcontractkit/chainlink-protos/workflows/go ../workflows/v2/capability_execution_started.proto
//go:generate protoc --proto_path=../ --go_out=./ --go_opt=module=github.com/smartcontractkit/chainlink-protos/workflows/go ../workflows/v2/capability_execution_finished.proto
//go:generate protoc --proto_path=../ --go_out=./ --go_opt=module=github.com/smartcontractkit/chainlink-protos/workflows/go ../workflows/v2/workflow_user_log.proto
//go:generate protoc --proto_path=../ --go_out=./ --go_opt=module=github.com/smartcontractkit/chainlink-protos/workflows/go ../workflows/v2/workflow_user_metric.proto
//go:generate protoc --proto_path=../ --go_out=./ --go_opt=module=github.com/smartcontractkit/chainlink-protos/workflows/go ../workflows/v2/xxx_no_send.proto

// sources/v1 - workflow metadata source service
Expand Down
253 changes: 253 additions & 0 deletions workflows/go/v2/workflow_user_metric.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions workflows/workflows/v2/workflow_user_metric.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
syntax = "proto3";

package workflows.v2;

import "workflows/v2/cre_info.proto";
import "workflows/v2/workflow_key.proto";

option go_package = "github.com/smartcontractkit/chainlink-protos/workflows/go/v2";

enum UserMetricType {
USER_METRIC_TYPE_UNSPECIFIED = 0;
USER_METRIC_TYPE_COUNTER = 1;
USER_METRIC_TYPE_GAUGE = 2;
}

message WorkflowUserMetric {
CreInfo creInfo = 1;
WorkflowKey workflow = 2;
string workflowExecutionID = 3;
Comment thread
alecgard marked this conversation as resolved.
string timestamp = 4;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


string name = 5;
double value = 6;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinking more about this, I don't know if this value will support histograms as they don't have a single value

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like official Prometheus protobufs use a more complex value: https://github.com/prometheus/client_model/blob/master/io/prometheus/client/metrics.proto#L75

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline - we're going to drop Histogram support for now and focus on the immediate use case of Counters and Gauges.

To support histograms we need to figure out:

  • How to define buckets
  • How to handle when the buckets change
  • How to handle initialisation
  • Where to aggregate into the Histogram value

UserMetricType type = 7;
map<string, string> labels = 8;
}
Loading