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

Use text/tabwriter for formatting alerts #3757

Open
Hackatosh opened this issue Mar 4, 2024 · 2 comments
Open

Use text/tabwriter for formatting alerts #3757

Hackatosh opened this issue Mar 4, 2024 · 2 comments

Comments

@Hackatosh
Copy link

Hackatosh commented Mar 4, 2024

Hello !

We would like to send alerts on Slack using a table format like this :

| Node | CPU Consumption |
| vm-aaaaa | 90% |
| vm-bbbb | 95% |

I think to do do something like this with proper formatting, we need to use text/tabwriter to do the templating (https://pkg.go.dev/text/tabwriter) in main/template/template.go

Is this something that could be implemented ?

@grobinson-grafana
Copy link
Contributor

text/tabwriter won't be much use in Slack because it doesn't use a monospace font.

@TheMeier
Copy link
Contributor

The font should be irrelevant for slack markdown. Also shouldn't be to hard to create a markdown-table with the tools already available

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