Error handling

    Allow the user to learn your plugin in small steps. Provide a useful default configuration so that:

    • You can avoid unnecessary error messages.

    For example, by selecting the first field of an expected type, the panel can display a visualization without any user configuration. If a user explicitly selects a field, then use that one. Otherwise, default to the first field of type :

    Display error messages

    Grafana displays the error message in the top-left corner of the panel.

    Error handling - 图2

    Here are some examples of situations where you might want to display an error to the user.