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

Create unqiue uid for grafana fluent-bit dashboard #503

Merged
merged 1 commit into from May 16, 2024

Conversation

captainpro-eng
Copy link
Contributor

@captainpro-eng captainpro-eng commented May 12, 2024

Conflict in UIDs of Grafana dashboard when running multiple Fluent Bit Helm Release.

Fixes #499

@captainpro-eng captainpro-eng changed the title Conflict in UIDs of Grafana dashboard when running multiple Fluent Bit release Create unqiue uid for grafana fluent-bit dashboard May 12, 2024
@captainpro-eng
Copy link
Contributor Author

@edsiper @stevehipwell @naseemkullah please review it.

@stevehipwell
Copy link
Collaborator

@captainpro-eng wont this implementation churn the uid with each Helm operation?

@captainpro-eng
Copy link
Contributor Author

wont this implementation churn the uid with each Helm operation?

didn't get your point. please explain it.

@stevehipwell
Copy link
Collaborator

@captainpro-eng the randAlphaNum function would cause the uid to change each time you ran helm upgrade.

To achieve what you're looking at doing I'd suggest using the following function which would be deterministic (assuming the result is a valid type for uid).

{{/*
Create the uid for grafana fluent-bit dashboard
*/}}
{{- define "fluent-bit.dashboard.uid" -}}
{{- sha256sum (printf "%s/%s" .Release.Namespace .Release.Name) }}
{{- end }}

@captainpro-eng
Copy link
Contributor Author

@captainpro-eng the randAlphaNum function would cause the uid to change each time you ran helm upgrade.

To achieve what you're looking at doing I'd suggest using the following function which would be deterministic (assuming the result is a valid type for uid).

{{/*
Create the uid for grafana fluent-bit dashboard
*/}}
{{- define "fluent-bit.dashboard.uid" -}}
{{- sha256sum (printf "%s/%s" .Release.Namespace .Release.Name) }}
{{- end }}

got it 👍

Copy link
Collaborator

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@captainpro-eng you will need to update the Chart.yaml to bump the version and change the release note annotations. Could you also squash your commits if possible.

@captainpro-eng
Copy link
Contributor Author

@captainpro-eng you will need to update the Chart.yaml to bump the version and change the release note annotations. Could you also squash your commits if possible.

@stevehipwell changes has been added.

@stevehipwell
Copy link
Collaborator

@captainpro-eng could you fix the failing DCO?

…t Helm Release.

Conflict in UIDs of Grafana dashboard when running multiple Fluent Bit Helm Release.

Conflict in UIDs of Grafana dashboard when running multiple Fluent Bit Helm Release.

Signed-off-by: jagdeep.khatana <khatanajagdeep1999@gmail.com>
@captainpro-eng
Copy link
Contributor Author

@captainpro-eng could you fix the failing DCO?

please review it.

stevehipwell
stevehipwell previously approved these changes May 16, 2024
Copy link
Collaborator

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @captainpro-eng, this LGTM.

Copy link
Collaborator

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@captainpro-eng I've just checked the docs and it looks like this behaviour could be achieved by just setting the value to null.

@captainpro-eng
Copy link
Contributor Author

@captainpro-eng I've just checked the docs and it looks like this behaviour could be achieved by just setting the value to null.

okay let me check

@captainpro-eng
Copy link
Contributor Author

captainpro-eng commented May 16, 2024

@captainpro-eng I've just checked the docs and it looks like this behaviour could be achieved by just setting the value to null.

i tested with null values facing same issue "the same UID is used more than once". if we set null it is genrating same uid for all helm release.

@stevehipwell
Copy link
Collaborator

i tested with null values facing same issue "the same UID is used more than once". if we set null it is genrating same uid for all helm release.

@captainpro-eng did you also set the id to null?

@captainpro-eng
Copy link
Contributor Author

i tested with null values facing same issue "the same UID is used more than once". if we set null it is genrating same uid for all helm release.

@captainpro-eng did you also set the id to null?

id is already null.

Copy link
Collaborator

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @captainpro-eng. It's a shame the documented Grafana behaviour doesn't work but this is a good solution so I don't think it's worth the time figuring out why now.

@stevehipwell stevehipwell merged commit a9833f7 into fluent:main May 16, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

Conflict in UIDs of Grafana dashboard when running multiple Fluent Bit Helm Release.
2 participants