Skip to content
Closed
Show file tree
Hide file tree
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
177 changes: 177 additions & 0 deletions docker/dev-full/grafana/dashboards/futures.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"links": [],
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"scaleDistribution": {
"type": "linear"
}
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 1,
"interval": "15s",
"options": {
"calculate": false,
"calculation": {
"xBuckets": {
"mode": "size"
}
},
"cellGap": 0,
"color": {
"exponent": 0.5,
"fill": "dark-orange",
"mode": "scheme",
"reverse": false,
"scale": "exponential",
"scheme": "RdBu",
"steps": 64
},
"exemplars": {
"color": "rgba(255,0,255,0.7)"
},
"filterValues": {
"le": 1e-9
},
Comment on lines +71 to +73
Copy link

Choose a reason for hiding this comment

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

logic: filterValues.le is set to 1e-9 which is an extremely small value that may filter out relevant data points. Consider adjusting or removing this filter.

"legend": {
"show": true
},
"rowsFrame": {
"layout": "auto"
},
"tooltip": {
"mode": "single",
"showColorScale": false,
"yHistogram": true
},
"yAxis": {
"axisPlacement": "left",
"max": "60",
"min": 0,
"reverse": false,
"unit": "s"
}
Comment on lines +85 to +91
Copy link

Choose a reason for hiding this comment

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

style: yAxis max value is hardcoded to 60s which may not be suitable for all future durations. Consider making this dynamic or configurable via variables.

},
"pluginVersion": "11.5.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "sum(increase(rivet_instrumented_future_duration_bucket{name=~\"[[name]]\", location=~\"[[location]]\"} [$__rate_interval])) by (le)",
"format": "heatmap",
"legendFormat": "{{le}}",
"range": true,
"refId": "A"
}
],
"title": "Instrumented Future Duration",
"type": "heatmap"
}
],
"preload": false,
"refresh": "30s",
"schemaVersion": 40,
"tags": [],
"templating": {
"list": [
{
"current": {
"text": [
"All"
],
"value": [
"$__all"
]
},
"definition": "label_values(rivet_instrumented_future_duration_count,name)",
"includeAll": true,
"label": "Name",
"multi": true,
"name": "name",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(rivet_instrumented_future_duration_count,name)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"type": "query"
},
{
"current": {
"text": [
"All"
],
"value": [
"$__all"
]
},
"definition": "label_values(rivet_instrumented_future_duration_count,location)",
"includeAll": true,
"label": "Location",
"multi": true,
"name": "location",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(rivet_instrumented_future_duration_count,location)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"type": "query"
}
]
},
"time": {
"from": "now-15m",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "Futures",
"version": 0,
"weekStart": ""
}
10 changes: 5 additions & 5 deletions packages/common/chirp-workflow/core/src/db/crdb_nats/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ impl Database for DatabaseCrdbNats {

#[tracing::instrument(skip_all)]
async fn update_worker_ping(&self, worker_instance_id: Uuid) -> WorkflowResult<()> {
// Always update ping
metrics::WORKER_LAST_PING
.with_label_values(&[&worker_instance_id.to_string()])
.set(rivet_util::timestamp::now());

sql_execute!(
[self]
"
Expand Down Expand Up @@ -263,11 +268,6 @@ impl Database for DatabaseCrdbNats {

#[tracing::instrument(skip_all)]
async fn publish_metrics(&self, worker_instance_id: Uuid) -> WorkflowResult<()> {
// Always update ping
metrics::WORKER_LAST_PING
.with_label_values(&[&worker_instance_id.to_string()])
.set(rivet_util::timestamp::now());

let acquired_lock = sql_fetch_optional!(
[self, (i64,)]
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ impl DatabaseDebug for DatabaseFdbSqliteNats {
.fdb()?
.run(|tx, _mc| {
let workflow_ids = workflow_ids.clone();
async move { self.get_workflows_inner(workflow_ids, &tx).await }.in_current_span()
async move { self.get_workflows_inner(workflow_ids, &tx).await }
})
.await
.map_err(Into::into)
Expand Down Expand Up @@ -469,7 +469,6 @@ impl DatabaseDebug for DatabaseFdbSqliteNats {

Ok(workflows)
}
.in_current_span()
})
.instrument(tracing::info_span!("find_workflows_tx"))
.await
Expand Down Expand Up @@ -725,7 +724,6 @@ impl DatabaseDebug for DatabaseFdbSqliteNats {

Ok(())
}
.in_current_span()
})
.instrument(tracing::info_span!("wake_workflows_tx"))
.await?;
Expand Down Expand Up @@ -990,7 +988,7 @@ impl DatabaseDebug for DatabaseFdbSqliteNats {
.fdb()?
.run(|tx, _mc| {
let signal_ids = signal_ids.clone();
async move { self.get_signals_inner(signal_ids, &tx).await }.in_current_span()
async move { self.get_signals_inner(signal_ids, &tx).await }
})
.instrument(tracing::info_span!("get_signals_tx"))
.await
Expand Down Expand Up @@ -1111,7 +1109,6 @@ impl DatabaseDebug for DatabaseFdbSqliteNats {

Ok(signals)
}
.in_current_span()
})
.instrument(tracing::info_span!("find_signals_tx"))
.await
Expand Down
Loading
Loading