Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New sha256sum uid for grafana dashboard exceeds 40 chars limit. #511

Open
iblexisnexis opened this issue May 28, 2024 · 4 comments
Open

Comments

@iblexisnexis
Copy link

New sha256sum uid for grafana dashboard exceeds 40 chars limit.

Fluent-bit chart version: 0.46.7

We get errors on grafana sidecar trying to save the dashboard:

log=logger=provisioning.dashboard type=file name=sidecarProvider t=2024-05-27T17:07:30.857026945Z level=error msg="failed to save dashboard" file=/tmp/dashboards/fluent-bit-fluent-bit.json error="uid too long, max 40 characters"

UID generated: 1b51768e3e61639b7fab3ec96497b1000ac59698053923ee3b891167b8050c70
which is 64 chars long.

@pmcgrath
Copy link

Yep, seeing the same

See grafana/grafana#11620

Being set

"uid": "{{ include "fluent-bit.dashboard.uid" . }}",

which uses

{{- sha256sum (printf "%s/%s" .Release.Namespace .Release.Name) }}

This PR introduced the uid which is too long #503

  • So went from a hard code uid which was 36 chars long and good
  • To a dynamic which is 64 chars long - bang

Have seen people ask about having multiple installations, see #289

Not sure if this is something people need with fluent-bit, but can see there is an option to deploy as a deployment rather than a daemonset, in which case it may make sense to NOT have a hard coded uid

Maybe having an optional way to pass a uid value via the values.yaml would work ?
See

Can see there is only a single dashboard at the moment, but what if more dashboards are added at https://github.com/fluent/helm-charts/tree/main/charts/fluent-bit/dashboards

So would be best to have as a lookup value I guess

@pmcgrath
Copy link

Another easier effort might be to replace the sha256sum usage with https://helm.sh/docs/chart_template_guide/function_list/#adler32sum

Can see it working with this with different release names we get between 9 and 10 chars

for rel_name in fluent-bit fluent-bit-a rel-a rel-b really-long-release-name-aaaaaaaaaaaaaaaaaaaaaaaaaa; do
	suffix=-fluent-bit
        [[ ${rel_name:0:10} == "fluent-bit" ]] && suffix=

	cm_name=${rel_name}${suffix}-dashboard-fluent-bit
	json_file_name=${rel_name}${suffix}-fluent-bit.json

	helm template ${rel_name} . \
		--namespace dest-ns \
		--set dashboards.enabled=True | \
		yq '. | select(.kind == "ConfigMap" and .metadata.name == "'${cm_name}'") | .data["'${json_file_name}'"]' | \
		jq -r '.title + " " + .uid'; 
done | column -ts ' '

fluent-bit                                                      1097533160
fluent-bit-a                                                    1341523830
rel-a-fluent-bit                                                577176767
rel-b-fluent-bit                                                577242304
really-long-release-name-aaaaaaaaaaaaaaaaaaaaaaaaaa-fluent-bit  2620200503

could then pad out to 40 chars which matches the grafana restriction

@pmcgrath
Copy link

See #509

@marcofranssen
Copy link

Facing the same, would be great to see #509 fix merged and released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants