Releases: grafana/grafana-plugin-sdk-rust
Releases · grafana/grafana-plugin-sdk-rust
v0.4.0
Changed
- The
DataServicetrait has a new associated type,Query, which corresponds to the type of the query sent from the frontend component of the plugin (theTQuerytype parameter of the frontendDatasourceApiimplementation). The backend SDK will attempt to deserialize the JSON into this struct, and it will be accessible on thequeryproperty of each query inQueryDataRequest.queries. Note thatQueryDataRequestis also now generic over this type. Within theDataServicetrait, it is simplest to useSelf::Queryto refer to the new type.
To retain the old behaviour, setQuery = serde_json::ValueinDataService. - Add
headersfield containing the allow-listed fields sent along with the request toCheckHealthRequest(see the Go SDK PR for more details) - Add
type_field containing the plugin type toDataSourceInstanceSettings. This is equal to theplugin_idfield onPluginContext. See the Go SDK PR for justification. - Add impl of
backend::IntoHttpResponseforhttp::Response<Vec<u8>>. - Remove unused lifetime on
IntoOptFieldblanket impl. - Derive
Eq(as well as justPartialEq) for various structs across the crate. - Bump arrow2 dependency to 0.14.0
- Bump prost to 0.11.0 and remove prost-build dependency, preferring checked-in generated code. This should speed up build times and remove the dependency on
protocsince we no longer need to compile proto definitions. - Bump tonic to 0.8.0 and remove tonic-build dependency.
- Bump serde_with dependency to 2.0.0
- Use cargo-release to automate release process
v0.3.0
Added
- Added various new constructors for
SubscribeStreamResponse,PublishStreamResponse
andCheckHealthResponse, reducing the reliance of knowing what the arguments should
be.
Deprecated
- The
CheckHealthResponse::new,SubscribeStreamResponse::newand
PublishStreamResponse::newmethods have been deprecated in favour of their new,
more direct constructors.
Changed
- Dependency bumps:
- prost 0.9.0 -> 0.10.0
- tonic 0.6.0 -> 0.7.0
- tonic-health 0.5.0 -> 0.6.0
InitialData::from_jsonnow only takes the desired JSONValueby reference rather than by
value.
v0.2.0
Added
- Bump arrow2 dependency to 0.10.0, and re-export it as
grafana_plugin_sdk::arrow2 - Added new
datafield toSubscribeStreamRequestandSubscribeStreamResponse,
matching the latest release of the protobuf descriptors. - More types now impl
FieldTypeandIntoFieldType:boolSystemTimechrono::Datechrono::NaiveDatechrono::NaiveDateTime
- The
FieldTypeandIntoFieldTypetraits are now public. These are useful when
writing generic functions to convert iterators, vecs, slices or arrays intoFields.
Changed
- Mark the various
RequestandResponsestructs in the backend part of the SDK as
#[non_exhaustive]since changes to those structs are largely outside of our control;
the protobuf descriptors may add additional fields, and this allows us to include them
without breaking our API. SomeResponsetypes now have new constructors which should
be used. - Most of the exported types in the
datapart of the SDK are also now non-exhaustive,
for the same reason as above. These types now either have separate constructors or
Defaultimpls which can be used to create them. - Derive
Clonefor various backend structs:AppInstanceSettingsDataSourceInstanceSettingsPluginContextRole(is also nowCopy)TimeRangeUser
- Change the
Iterassociated type ofbackend::DataServicetoStream, and update
the return type ofquery_dataaccordingly. This allows each inner query to be handled
asynchronously and concurrently in a simple way. - The
live::Errortype is now an enum and provides more detail on failures. - The
pathfield ofSubscribeStreamRequest,RunStreamRequestand
PublishStreamRequestare nowlive::Pathtypes rather than arbitrary strings.