The document used by the tag is too simple

I think it is difficult for me to understand the use of labes in your help documents. I’ve been using grafana for about a month now, but I haven’t figured out how to use labes and template yet.

I went to the community looking for help, and something shocked me. I see that most people are asking questions about alert, and there are over 1500 people talking about Alert. I hope you can optimize the document

@liuquanlong2017 thank you for sharing your experience. We’re working to continue to improve the docs and examples. Do you mind sharing which parts of the documentation you felt could use the most improvement and any suggestions you have about what was missing?

Did you review this page? Labels and annotations | Grafana documentation To me, it’s one of the most relevant ones for alerting and labels. It’s great to hear the perspective of someone starting to learn grafana so we can make it easier to use.

Do you have any feedback about the way the docs are organized? How much effort did it take to find the content you were looking for?

1 Like

Thank you very much for answering my question.And I wish you a happy women’s day
I have seen this page( Labels and annotations | Grafana documentation), but I still don’t understand the concept of labels. Because this concept also appears here

I tried according to the example in the picture, but I couldn’t print the results I wanted as scheduled.This makes me very distressed. Why can’t I try according to the document?

If you can use an example to illustrate the function, I think I will understand it much faster
Alert instances

For example, here you have described the monitoring of multiple CPUs, and then?
Why don’t you use this column to explain the following alarms and message templates,
Here is a screenshot of my first time using grafana

Finally, here is a screenshot of my first time using grafana

I am a Chinese user, but there are few domestic users, so there are not many related tutorials. So I can only solve my problem with the help of official documents
Thank you very much for listening to my suggestions

In addition, can you help me solve my current problem?

As shown in the figure above, how can I print the IP address of the current server every time I send an alarm notification?
I think the notification and alarm of version 8 and 9 updates are too complex, especially the selection of go language for alarm template, which raises a lot of threshold. I browsed your reply to other people’s questionsHow To Use Alert Message Templates in Grafana

It’s so complex. Compared with version 7, it feels simpler, but the function cannot meet more extensions

@liuquanlong2017 thank you for sharing your experience and feedback about the docs and the alerting feature! I am working on creating a tutorial for alerting with Loki, this is valuable insight for me.

For the problem you’re facing now . . .

  1. You will want to add the IP address label to your query, for example, I added a label called agent_hostname to a similar query here:

    (1 - avg (irate(node_cpu_seconds_total{mode="idle"}[5m])) by(job,agent_hostname)) *100

  2. You can also simplify the condition with a classic condition, so you will get only one result set to work with instead of two:

In the next step, you will add an annotation to the alert. This sample annotation will iterate through the query results and return the hostname & CPU value from the query:

{{ with $values }}
{{ range $k, $v := . }}
   Hostname: {{$v.Labels.agent_hostname}}
   CPU value: {{ $v }}
{{ end }}
{{ end }}

This is how it will look in the alerts page when the query is firing:

To complete the process, you’ll want to follow the instructions in How To Use Alert Message Templates in Grafana to do these last two steps:

  • Create your custom Alert Template (myalert and mymessage)
  • Add them to the notification policy

I hope this helps to explain why you weren’t seeing the IP address in your query result.

I am aware that there are a lot of parts to set up and it can be very confusing. We’re working on improving the workflow and the documentation.

Thank you very much for your answer.After reading your answer, I found a problem.
It seems that your alarm and correlation are based on Prometheus as a reference, but before I used grafana, I only used Prometheus to obtain the monitoring data content, instead of using alertmanager as an alarm. So I don’t know anything about Prometheus alarms.
I just went to read the relevant documents about alertmanager. I found that their documents are very easy to understand, while your documents are very complex.
“Minimize others and that lose one’s own individuality”, you are an integrated platform. What you need to consider is how to simplify some complex things, rather than being the same or more complex as the native ones.

Here are some of my suggestions. I hope they can help you

1 Like