You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi team,
As a part of developing Aerospike integration dashboards, we need to create a query using conditional operators such as IF, OR. But we are not able to replicate the exact query as similar to Grafana. Grafana's query:
(sum( # Running individual exporter for each node in a cluster
(avg by (ns) ( aerospike_namespace_ns_cluster_size {job="$job_name", } ))
== bool
(count by (ns) (aerospike_namespace_ns_cluster_size {job="$job_name", } ))
)> bool 0) * # migration check with RX metric
(sum((sum by (ns) (aerospike_namespace_migrate_rx_partitions_remaining + aerospike_namespace_migrate_tx_partitions_remaining) != bool 0))
== bool 0) * # Consistent Effective Replication factor across all nodes
(sum(
min by (ns) (aerospike_namespace_effective_replication_factor {job="$job_name", })
== bool
max by (ns) (aerospike_namespace_effective_replication_factor {job="$job_name", })
) > bool 0)
But the above Datadog query does not fetch the required output, can someone please help in understanding the usage of conditional functions in Datadog queries?
Thank you
cc @ @gandham-santhosh@srikanth-6520@raj-Optit
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi team,
As a part of developing Aerospike integration dashboards, we need to create a query using conditional operators such as IF, OR. But we are not able to replicate the exact query as similar to Grafana.
Grafana's query:
(sum( # Running individual exporter for each node in a cluster
(avg by (ns) ( aerospike_namespace_ns_cluster_size {job="$job_name", } ))
== bool
(count by (ns) (aerospike_namespace_ns_cluster_size {job="$job_name", } ))
)> bool 0) * # migration check with RX metric
(sum((sum by (ns) (aerospike_namespace_migrate_rx_partitions_remaining + aerospike_namespace_migrate_tx_partitions_remaining) != bool 0))
== bool 0) * # Consistent Effective Replication factor across all nodes
(sum(
min by (ns) (aerospike_namespace_effective_replication_factor {job="$job_name", })
== bool
max by (ns) (aerospike_namespace_effective_replication_factor {job="$job_name", })
) > bool 0)
Query tried in Datadog:
{
"title": "Cluster - Historical - Usage Bytes",
"type": "query_value",
"requests": [
{
"formulas": [
{
"formula": "((count_nonzero(query1) / count_nonzero(query2)) * (abs(count_nonzero(query3) + count_nonzero(query4)) + 1) * (count_nonzero(query5) / count_nonzero(query6)) * (query7 / query8) / query9) - (query10 * 39)"
}
],
"queries": [
{
"name": "query1",
"data_source": "metrics",
"query": "avg:aerospike.aerospike_namespace_ns_cluster_size{$aerospike_cluster}",
"aggregator": "last"
},
{
"name": "query2",
"data_source": "metrics",
"query": "count:aerospike.aerospike_namespace_ns_cluster_size{$aerospike_cluster}",
"aggregator": "last"
},
{
"name": "query3",
"data_source": "metrics",
"query": "sum:aerospike.aerospike_namespace_migrate_rx_partitions_remaining{$aerospike_cluster}",
"aggregator": "last"
},
{
"name": "query4",
"data_source": "metrics",
"query": "sum:aerospike.aerospike_namespace_migrate_tx_partitions_remaining{$aerospike_cluster}",
"aggregator": "last"
},
{
"name": "query5",
"data_source": "metrics",
"query": "min:aerospike.aerospike_namespace_effective_replication_factor{$aerospike_cluster}",
"aggregator": "last"
},
{
"name": "query6",
"data_source": "metrics",
"query": "max:aerospike.aerospike_namespace_effective_replication_factor{$aerospike_cluster}",
"aggregator": "last"
},
{
"name": "query7",
"data_source": "metrics",
"query": "sum:aerospike.aerospike_namespace_data_used_bytes{$aerospike_cluster}",
"aggregator": "last"
},
{
"name": "query8",
"data_source": "metrics",
"query": "avg:aerospike.aerospike_namespace_effective_replication_factor{$aerospike_cluster}",
"aggregator": "last"
},
{
"name": "query9",
"data_source": "metrics",
"query": "avg:aerospike.aerospike_namespace_data_compression_ratio{$aerospike_cluster}",
"aggregator": "last"
},
{
"name": "query10",
"data_source": "metrics",
"query": "sum:aerospike.aerospike_namespace_master_objects{$aerospike_cluster}",
"aggregator": "last"
}
],
"response_format": "scalar",
"conditional_formats": [
{
"comparator": ">=",
"value": 0,
"palette": "white_on_green"
}
]
}
],
"autoscale": true,
"text_align": "center",
"custom_links": [],
"precision": 2,
"timeseries_background": {
"type": "area",
"yaxis": {
"include_zero": true
}
}
}
But the above Datadog query does not fetch the required output, can someone please help in understanding the usage of conditional functions in Datadog queries?
Thank you
cc @ @gandham-santhosh @srikanth-6520 @raj-Optit
Beta Was this translation helpful? Give feedback.
All reactions