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
Is there a way to properly use the mysqld-mixin/mixin.libsonnet to import rules and alerts?
For example with prometheus/kube-prometheus, I was trying to do:
local thanosMixin = import'thanos-mixin/mixin.libsonnet';
local corednsMixin = import'coredns-mixin/mixin.libsonnet';
local certManagerMixin = import'cert-manager-mixin/mixin.libsonnet';
// trying to use mysqld-mixin the same way as otherslocal mysqldMixin = import'mysqld-mixin/mixin.libsonnet';
local kp =
(import'kube-prometheus/kube-prometheus.libsonnet') +
(import'thanos-mixin/config.libsonnet') +
{
_config+:: {
namespace:'monitoring',
},
prometheusRules+::
thanosMixin.prometheusRules +
certManagerMixin.prometheusRules +
// trying to use mysqld-mixin the same way as others
mysqldMixin.prometheusRules +
{
// groups+: [],
},
prometheusAlerts+::
thanosMixin.prometheusAlerts +
corednsMixin.prometheusAlerts +
certManagerMixin.prometheusAlerts +
// trying to use mysqld-mixin the same way as others
mysqldMixin.prometheusAlerts +
{
// cat existingrule.yaml | gojsontoyaml -yamltojson > existingrule.json// groups+: (import 'existingrule.json').groups,
},
}
But I end up with the following error:
+ jsonnet -J vendor -m manifests kube-prometheus.jsonnet
+ xargs '-I{}' sh -c 'cat {} | gojsontoyaml > {}.yaml' -- '{}'
RUNTIME ERROR: only functions can be called, got null
vendor/mysqld-mixin/mixin.libsonnet:9:14-44 object <anonymous>
The text was updated successfully, but these errors were encountered:
It's been a while, but also facing the same problem while using go-jsonnet instead of mixtool which provides Tanka native functions on top of standard jsonnet.
I guess mysqld-mixin chose to use parseYaml native function when it was not available to standard jsonnet implementation, but since jsonnet standard library provides parseYaml since some time, why not using it?
Is there a way to properly use the
mysqld-mixin/mixin.libsonnet
to import rules and alerts?For example with
prometheus/kube-prometheus
, I was trying to do:But I end up with the following error:
The text was updated successfully, but these errors were encountered: