class MyCustomDS extends RuntimeDataSource {
query(request: DataQueryRequest<DataQuery>): Promise<DataQueryResponse> | Observable<DataQueryResponse> {
return Promise.resolve({
state: LoadingState.Done,
data: [
{
fields: [{ name: 'Values', type: FieldType.number, values: [1, 2, 3], config: {} }],
length: 3,
},
],
});
}
testDatasource(): Promise<TestDataSourceResponse> {
return Promise.resolve({ status: 'success', message: 'OK' });
}
}
// Important to specify a unique pluginId and uid for your data source that is unlikely to confict with any other scene app plugin.
sceneUtils.registerRuntimeDataSource({ dataSource: new MyCustomDS('my-custom-ds', 'my-custom-ds-uid') });
How do i make in my constants.ts a custom datasource with a specific ip prometheus.
type: Prometheus
URL: http://x.x.x.x:9090
HTTPmethode: POST
... do i use this custom code and how to use it since documentation dont talk much about it. https://github.com/grafana/scenes/blob/c32882c8b4d0f6fad2dde39e5ab8e5822a989372/docusaurus/docs/advanced-custom-datasource.md?plain=1#L2