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
Today I was looking to use ${INSTANCE} environment variable but only found support for ${HOST}. The reason being that ${INSTANCE} environment variable is declared in the examples/k8s/deployment.yaml file.
func expandVars(in string) (out string) {
switch in {
case "HOST":
hostname, _ := os.Hostname()
// in case hostname is an fqdn or has dots, only take first part
parts := strings.SplitN(hostname, ".", 2)
return parts[0]
case "GRAFANA_NET_ADDR":
return os.Getenv("GRAFANA_NET_ADDR")
case "GRAFANA_NET_API_KEY":
return os.Getenv("GRAFANA_NET_API_KEY")
case "GRAFANA_NET_USER_ID":
return os.Getenv("GRAFANA_NET_USER_ID")
default:
return "$" + in
}
Would you be open to supporting a new variable instead of using the default ${HOST}?
func expandVars(in string) (out string) {
switch in {
case "INSTANCE":
return os.Getenv("INSTANCE")
case "HOST":
hostname, _ := os.Hostname()
// in case hostname is an fqdn or has dots, only take first part
parts := strings.SplitN(hostname, ".", 2)
return parts[0]
case "GRAFANA_NET_ADDR":
return os.Getenv("GRAFANA_NET_ADDR")
case "GRAFANA_NET_API_KEY":
return os.Getenv("GRAFANA_NET_API_KEY")
case "GRAFANA_NET_USER_ID":
return os.Getenv("GRAFANA_NET_USER_ID")
default:
return "$" + in
}
The text was updated successfully, but these errors were encountered:
Hello,
Today I was looking to use ${INSTANCE} environment variable but only found support for ${HOST}. The reason being that ${INSTANCE} environment variable is declared in the examples/k8s/deployment.yaml file.
After reading the carbon-relay-ng code https://github.com/grafana/carbon-relay-ng/blob/master/cmd/carbon-relay-ng/carbon-relay-ng.go#L74, only found support for ${HOST}
Would you be open to supporting a new variable instead of using the default ${HOST}?
The text was updated successfully, but these errors were encountered: