Skip to content

Commit

Permalink
Merge branch 'main' into identical-consensus-agg-config
Browse files Browse the repository at this point in the history
  • Loading branch information
vreff authored Jan 9, 2025
2 parents 7c80c68 + c2007b3 commit 97a06d6
Show file tree
Hide file tree
Showing 10 changed files with 272 additions and 204 deletions.
39 changes: 38 additions & 1 deletion observability-lib/grafana/panels.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,37 @@ func newTransform(options *TransformOptions) dashboard.DataTransformerConfig {
}
}

type ToolTipOptions struct {
Mode common.TooltipDisplayMode
Sort common.SortOrder
MaxWidth *float64
MaxHeight *float64
}

func newToolTip(options *ToolTipOptions) *common.VizTooltipOptionsBuilder {
if options.Mode == "" {
options.Mode = common.TooltipDisplayModeSingle
}

if options.Sort == "" {
options.Sort = common.SortOrderNone
}

builder := common.NewVizTooltipOptionsBuilder().
Mode(options.Mode).
Sort(options.Sort)

if options.MaxWidth != nil {
builder.MaxWidth(*options.MaxWidth)
}

if options.MaxHeight != nil {
builder.MaxHeight(*options.MaxHeight)
}

return builder
}

type PanelOptions struct {
Datasource string
Title string
Expand Down Expand Up @@ -230,6 +261,7 @@ type TimeSeriesPanelOptions struct {
FillOpacity float64
ScaleDistribution common.ScaleDistribution
LegendOptions *LegendOptions
ToolTipOptions *ToolTipOptions
ThresholdStyle common.GraphThresholdsStyleMode
}

Expand All @@ -244,6 +276,10 @@ func NewTimeSeriesPanel(options *TimeSeriesPanelOptions) *Panel {
options.LegendOptions = &LegendOptions{}
}

if options.ToolTipOptions == nil {
options.ToolTipOptions = &ToolTipOptions{}
}

newPanel := timeseries.NewPanelBuilder().
Datasource(datasourceRef(options.Datasource)).
Title(options.Title).
Expand All @@ -257,7 +293,8 @@ func NewTimeSeriesPanel(options *TimeSeriesPanelOptions) *Panel {
Legend(newLegend(options.LegendOptions)).
ScaleDistribution(common.NewScaleDistributionConfigBuilder().
Type(options.ScaleDistribution),
)
).
Tooltip(newToolTip(options.ToolTipOptions))

if options.Min != nil {
newPanel.Min(*options.Min)
Expand Down
2 changes: 2 additions & 0 deletions pkg/capabilities/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ type RequestMetadata struct {
WorkflowDonConfigVersion uint32
// The step reference ID of the workflow
ReferenceID string
// Use DecodedWorkflowName if the human readable name needs to be exposed, such as for logging purposes.
DecodedWorkflowName string
}

type RegistrationMetadata struct {
Expand Down
328 changes: 170 additions & 158 deletions pkg/capabilities/pb/capabilities.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pkg/capabilities/pb/capabilities.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ message RequestMetadata {
uint32 workflow_don_id = 6;
uint32 workflow_don_config_version = 7;
string reference_id = 8;
string decoded_workflow_name = 9;
}

message CapabilityRequest {
Expand Down
2 changes: 2 additions & 0 deletions pkg/capabilities/pb/capabilities_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func CapabilityRequestToProto(req capabilities.CapabilityRequest) *CapabilityReq
WorkflowDonId: req.Metadata.WorkflowDonID,
WorkflowDonConfigVersion: req.Metadata.WorkflowDonConfigVersion,
ReferenceId: req.Metadata.ReferenceID,
DecodedWorkflowName: req.Metadata.DecodedWorkflowName,
},
Inputs: values.ProtoMap(inputs),
Config: values.ProtoMap(config),
Expand Down Expand Up @@ -101,6 +102,7 @@ func CapabilityRequestFromProto(pr *CapabilityRequest) (capabilities.CapabilityR
WorkflowDonID: md.WorkflowDonId,
WorkflowDonConfigVersion: md.WorkflowDonConfigVersion,
ReferenceID: md.ReferenceId,
DecodedWorkflowName: md.DecodedWorkflowName,
},
Config: config,
Inputs: inputs,
Expand Down
1 change: 1 addition & 0 deletions pkg/capabilities/pb/capabilities_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func TestMarshalUnmarshalRequest(t *testing.T) {
WorkflowDonID: 1,
WorkflowDonConfigVersion: 1,
ReferenceID: anyReferenceID,
DecodedWorkflowName: "test-workflow-name",
},
Config: &values.Map{Underlying: map[string]values.Value{
testConfigKey: &values.String{Underlying: testConfigValue},
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflows/wasm/host/wasip1.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func pollOneoff(caller *wasmtime.Caller, subscriptionptr int32, eventsptr int32,
// - 8-16: timeout
// - 16-24: precision
// - 24-32: flag
newTimeout := binary.LittleEndian.Uint16(argBuf[8:16])
newTimeout := binary.LittleEndian.Uint64(argBuf[8:16])
flag := binary.LittleEndian.Uint16(argBuf[24:32])

var errno Errno
Expand Down
99 changes: 55 additions & 44 deletions pkg/workflows/wasm/pb/wasm.pb.go

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

1 change: 1 addition & 0 deletions pkg/workflows/wasm/pb/wasm.proto
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ message FetchRequestMetadata {
string workflowName = 2;
string workflowOwner = 3;
string workflowExecutionId = 4;
string decodedWorkflowName = 5;
}

message FetchRequest {
Expand Down
1 change: 1 addition & 0 deletions pkg/workflows/wasm/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ func createFetchFn(
WorkflowName: sdkConfig.Metadata.WorkflowName,
WorkflowOwner: sdkConfig.Metadata.WorkflowOwner,
WorkflowExecutionId: sdkConfig.Metadata.WorkflowExecutionID,
DecodedWorkflowName: sdkConfig.Metadata.DecodedWorkflowName,
},
})
if err != nil {
Expand Down

0 comments on commit 97a06d6

Please sign in to comment.