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

Make sure that the plugin returns a Grafana-readable timestamp format #161

Closed
idastambuk opened this issue May 4, 2023 · 1 comment
Closed

Comments

@idastambuk
Copy link
Contributor

idastambuk commented May 4, 2023

A while ago we got a bug report with an unusual time format coming from AWS OpenSearch that wasn't readable by our histogram panel (or any other time-based vis plugin, most likely). The problem in this case is that the LogsVolumePanel is using moment.js to format this field, and encountering an unsupported string.

I suggested to the user to format the data on their end, but it seems like Elasticsearch plugin squad is implementing something that we could mirror and that might rid us of this problem without having to manually add support for each strange format.

Quoting @gabor:

...When we make the search-json-object, (at this point we do know what the timestamp-field’s name is), we do:
{
   ...
   "fields": [{"field":"@timestamp", "format":"something-that-grafana-likes"}]
}
if we run the search like this, in the elastic-response, there will be the hits array, where every item contains the _source attribute with the full objects. but now it will also have a fields array. so, we now take the timestamp-field-value from teh fields part, and ignore it in the _source part.
at least this is our plan 
i did a quick check, and that field is available in OpenSearch too: https://opensearch.org/docs/latest/api-reference/search/#request-body

I think that should be enough to start investigating, there's a bit more info in this thread

@idastambuk idastambuk added the good first issue Good for newcomers label May 4, 2023
@idastambuk idastambuk changed the title Make sure that the plugin returns a Grafana-readable format Make sure that the plugin returns a Grafana-readable timestamp format Jun 13, 2023
@idastambuk
Copy link
Contributor Author

Fixed in #203 for logs + raw_data. It wasn't a problem in metrics type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants