Module grafana_plugin_sdk::data
source · Expand description
Data types used throughout the SDK.
Note that many of the types in this module are marked as #[non_exhaustive]
and cannot
be constructed using struct expressions. This is because Grafana may choose to add
additional fields or variants at any time. Instead, use the constructor (if available) or
create a mutable default value using Default::default()
and modify any fields.
For example:
use grafana_plugin_sdk::{
data::{Field, FieldConfig, Frame, Metadata, Notice, Severity},
prelude::*,
};
let mut field_config = FieldConfig::default();
field_config.display_name_from_ds = Some("X".to_string());
let field = ["a", "b", "c"]
.into_field("x")
.with_config(field_config);
let mut notice = Notice::new("warning! this is important".to_string());
notice.severity = Some(Severity::Warning);
let mut metadata = Metadata::default();
metadata.path = Some("my path".to_string());
metadata.notices = Some(vec![notice]);
let frame = Frame::new("my frame")
.with_field(field)
.with_metadata(metadata);
Structs
- A reference to a checked and verified
Frame
, which is ready for serialization. - A wrapper around an
Option<f64>
used in various backend data structures, with custom NaN and Infinity serialization. - Links to use when clicking on a result.
- A typed column within a
Frame
. - The display properties for a
Field
. - A structured, two-dimensional data frame.
- Metadata about a
Frame
. - A notification to be displayed in Grafana’s UI.
- Used for storing arbitrary statistics metadata related to a query and its results.
- A single step on the threshold list.
- Configuration for thresholds for a field.
- The type information for a
Frame
as understood by Grafana. - A new value to be displayed when a
ValueMapping
matches an input value.
Enums
- Errors that can occur when interacting with the Grafana plugin SDK.
- Options for customizing the way a
Frame
is serialized. - A suggestion for which tab to display in the panel inspector in Grafana’s UI.
- The severity level of a notice.
- The ‘simple’ type of this data.
- Special values that can be mapped to new text and colour values.
- How thresholds should be evaluated.
- Valid types understood by Grafana.
- Allows input values to be mapped to text and colour.
- Visualiation type options understood by Grafana.
Constants
- The string representation for null values.
- The standard name for time series time fields.
- The standard name for time series value fields.