Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for micro- and nanosecond timestamps #272

Open
Xasin opened this issue Apr 6, 2022 · 0 comments
Open

Option for micro- and nanosecond timestamps #272

Xasin opened this issue Apr 6, 2022 · 0 comments
Labels
type/feature-request Requested new feature or enhancement

Comments

@Xasin
Copy link

Xasin commented Apr 6, 2022

Greetings Mr. Olsson,

I have recently started an internship at a section of the Max Plank institute.
Their current database system does not have good options to plot and monitor multiple streams of data, however their database has a JSON API that is almost compatible with your Grafana JSON Datasource.
As such I was hoping to make use of your adapter as well as Grafana to get a better overview of their measurements.

I am able to properly fetch data from an endpoint and extract the necessary timestamps and data values.

However, they are using a timestamp with nanosecond precision, given in a numeric format (as integer).
This value is parsed just fine, but Grafana itself refuses to accept this data column as timestamp, which does not allow it to be plotted in any of the time-series based panels.

An example API response would be:

{
  "label": "ActV1AAT10CH001",
  "values": [
    0.0,
    0.0,
   [etc.]
  ],
  "dimensions": [
    1403787587626000000,
    1403787687627000000,
    1403787787627000000,
    1403787887627000000,
    [etc.]
  ],
  "sampleCount": 10,
  "unit": "unknown",
  "datatype": "Float",
  "dimensionCount": 1,
  "dimensionSize": 10
}

I believe the easiest way to make this work is to add another column type, similar to "time", perhaps called "time as ns". It would
merely have to divide the given timestamp by 1000000 and generate a timestamp that Grafana can work with.
The loss of precision should not be an issue - the data example above already shows that some of their measurement streams don't make use of the ns precision.

I would be willing to dig in to the code and add this feature myself, however I have little experience in writing Grafana plugins, and was wondering how hard this would be to implement with your current system architecture.
Perhaps it just requires a small addition to the initial data parser?

Best regards,
D. Bailey

@gabor gabor added the type/feature-request Requested new feature or enhancement label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature-request Requested new feature or enhancement
Projects
Status: Backlog
Development

No branches or pull requests

2 participants