Hiya, I'm not quite sure if this is a jsonnet issue or a grafonnet issue, so I'll start here.
Problem
I'm passing in a title to dashboard.new() like below:
# dashboard.jsonnet
local g = import '../../grafana.libsonnet';
local CONSTANTS = '../constants.libsonnet';
local uids = import '../uids.libsonnet';
local ec2 = import './panels/ec2_metrics.libsonnet';
local create_dashboard(region = "multi_staging_marketing") =
local region_constants = CONSTANTS.regions[region];
{
folderUid: uids.regions[region].folder,
overwrite: true,
dashboard: g.dashboard.new(region_constants.name + " - EC2 Metrics")
+ g.dashboard.withTimezone("browser")
+ g.dashboard.graphTooltip.withSharedCrosshair()
+ g.dashboard.withPanels(
ec2.cpu(region)
)
};
{
"multi-staging-marketing-ec2.json": create_dashboard("multi_staging_marketing")
}
and I'm getting an error that I'm passing in an unexpected string and that it expects a number:
NOTE: The way in which I'm passing through the name of the region and env has been done in other dashboard.jsonnet files and they compile and run just fine. This seems to be an exception of some sort.
I have a constants.libsonnet file that holds all of the identifying information for each region and environment that gets passed through to our dashboard.jsonnet files. It looks like this (the ellipsis redacting sensitive info):
I can pass in the title explicitly like so g.dashboard.new("Multi-staging Marketing EC2 Metrics") and it works just fine. Has anyone ran into an issue like this: passing in a typed value to an object that is expecting that type but on runtime is expecting a different type?
Hiya, I'm not quite sure if this is a jsonnet issue or a grafonnet issue, so I'll start here.
Problem
I'm passing in a title to dashboard.new() like below:
and I'm getting an error that I'm passing in an unexpected string and that it expects a number:
NOTE: The way in which I'm passing through the name of the region and env has been done in other dashboard.jsonnet files and they compile and run just fine. This seems to be an exception of some sort.
I have a constants.libsonnet file that holds all of the identifying information for each region and environment that gets passed through to our dashboard.jsonnet files. It looks like this (the ellipsis redacting sensitive info):
I can pass in the title explicitly like so
g.dashboard.new("Multi-staging Marketing EC2 Metrics")
and it works just fine. Has anyone ran into an issue like this: passing in a typed value to an object that is expecting that type but on runtime is expecting a different type?