Customize dashboard parameters
Learn how you can add more complex filters to your dashboard cards.
When you Add dashboard parameters in Observe, the bindings have the following properties by default:
- They apply only to a single field or tag.
- They filter that field or tag to be equal to the selected value(s).
For example:
filter clusterName = $Cluster_Name or is_null($Cluster_Name) //single-value
filter array_contains($k8s_cluster-name, #k8s.cluster.name) or is_null($k8s_cluster_name) //multi-value
You can apply more complex filters to your dashboard cards. For example:
- Dynamically adjusting a chart query. You can adjust the resolution of a time chart while viewing a dashboard by directly injecting a parameter into the
timechartOPAL verb. - Filtering using a non-equality. You can apply range filters to your dashboard cards, such as a parameter that filters to duration greater than (>) some input, or a contains filter, such as a parameter that filters to all service names that contain batchjob. To do either of these cases, you must manually edit the default parameter OPAL binding to use a different filter operator.
Tips for creating custom parameter binding expressions:
- Make sure your parameter input matches the type of field you want to filter. Most parameters apply values of type
string(with the exception of number parameters, which are typefloat64). So if you want to create a single-value that filters durations above a threshold, make sure to convert your parameter from astringto adurationusingparse_duration(). - Once you create a custom parameter binding expression, you’ll be locked into OPAL mode and will no longer be able to bind parameters to that modified card using the UI.
Example: Dynamically adjust the timechart resolution
Create a single-value parameter and define a set of custom values that represent different time buckets. For example:

Replace the resolution in your time chart with $test_span, and convert that parameter (string) to type duration using parse_duration :
timechart options(empty_bins:true), parse_duration($test_span), A_WebAppUserEventsv2_count:count(), group_by(clusterName)
Example: Filter duration greater than some threshold
Create a number parameter and bind it to your selected card.

Then alter that binding expression to use greater than (>) instead of equals (=), and convert the parameter from float64 to a duration.
filter duration > duration_ms($Minimum_duration_ms) or is_null($Minimum_duration_ms)
Example: Filter service name based on partial match
Create a text parameter and bind it to your selected card.

Then alter that binding expression to use contains() instead of =. There’s no need to convert the parameter type because contains() already accepts strings.
filter contains(clusterName,$Test_contains) or $Test_contains = ""
Updated 40 minutes ago