Coder Social home page Coder Social logo

fiskaly / grafana.surrealdb Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 513 KB

Grafana Datasource Plugin for SurrealDB

Home Page: https://grafana.com/grafana/plugins/fiskaly-surrealdb-datasource/

License: Other

JavaScript 6.68% Dockerfile 1.17% TypeScript 43.43% Go 45.07% Makefile 3.64%
grafana grafana-datasource grafana-plugin surrealdb

grafana.surrealdb's People

Contributors

ppaulweber avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

grafana.surrealdb's Issues

database creation with api namespace is missing

when i try to create a database with the api of grafana namespace is missing.
i send this json:
{'name': 'Surrealdb', 'type': 'fiskaly-surrealdb-datasource', 'typeName': 'SurrealDB', 'url': 'surrealdb:8000', 'access': 'proxy', 'withCredentials': False, 'basicAuth': False, 'jsonData': {'database': 'test', 'location': 'surrealdb:8000', 'namespace': 'test', 'username': 'root', 'password': 'root'}, 'uid': 'surrealdb', 'isDefault': True, 'database': 'fiskaly-surrealdb-datasource'}
a this end point:
POST /api/datasources
when i login and show the new database i get this:
image
the namespace is missing .
can you test it and verify.
thanks

Initial Review and Publishing Process

In order to have this data source plugin published in the Grafana plugin catalog we have received the following change requests:

  • provide missing hide functionality (either frontend or backend side) of a given data source
  • rework the metric query mode user experience
  • handle query state changes correctly in the frontend to only send necessary JSON data along with the query request
  • provide clear separation of plugin.Datasource configuration and JSON data model and JSON secrets, see:
    Password string `json:"password"` // secrets
  • remove necessary getResource frontend calls and still not used backend logic, see: https://github.com/fiskaly/grafana.surrealdb/blob/v0.1.0/src/datasource.ts#L26 and
    func (r *Datasource) CallResource(ctx context.Context, request *backend.CallResourceRequest, response backend.CallResourceResponseSender) error {
    // log.DefaultLogger.Info(fmt.Sprintf("CallResource: %s", request.Path))
    switch request.Path {
    // case "TODO":
    // return response.Send(
    // &backend.CallResourceResponse{
    // Status: http.StatusOK,
    // Body: []byte(`{}`),
    // },
    // )
    default:
    return response.Send(
    &backend.CallResourceResponse{
    Status: http.StatusNotFound,
    Body: []byte(`{}`),
    },
    )
    }
    }
  • replace the panic() with an empty string, see:
    panic(fmt.Sprintf("invalid QueryMode state '%d'", r))
  • remove query syntax checks and use directly the checks by the underlying data source, see:
    if strings.HasPrefix(surql, "select") == false &&
    strings.HasPrefix(surql, "SELECT") == false &&
    strings.HasPrefix(surql, "info") == false &&
    strings.HasPrefix(surql, "INFO") == false &&
    strings.HasPrefix(surql, "return") == false &&
    strings.HasPrefix(surql, "RETURN") == false {

timestamp in query

Hello ,
i create a timeserie:

{
    "id": "timetable:03jl9sgvaey8b2bh53tq",
    "location": "location:361820095V6",
    "person": "person:CLEA",
    "timestamp": "2024-02-22 21:41:01.123333"
}
or
{
    "id": "timetable:03jl9sgvaey8b2bh53tq",
    "location": "location:361820095V6",
    "person": "person:CLEA",
    "timestamp": "2024-02-22T21:41:01.123333"
}

i want to view it on grafana but the field timestamp doesnt work for date selection
and i cant see it in table mode:
image

the field timestamp is empty.
even if i choose timeseries ...
image
the timerange doesnt affect the result
image

is there a specific way to save timestamp ? what form ?
thanks in advance
lucile

improvment: anotation query

hello,
I try to use surrealdb plugin to anotate.
it is visible in the dashboard but no way to write query.
is it possible to add the query textarea ?
thanks.

image

live query in grafana.

is it possible to make this plugin work with live query in grafana : datasource with live support.
it needs channel
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.