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

Opensearch datasource not working properly with data.timestamp field in grafana #425

Open
SricharanSundar opened this issue Jul 23, 2024 · 5 comments
Labels
datasource/OpenSearch type/bug Something isn't working

Comments

@SricharanSundar
Copy link

SricharanSundar commented Jul 23, 2024

What happened:
The time field is not properly mapped with grafana time series visualization. I written the lucene query in grafana to plot a time and counts based on data.timestamp field. But the visualization is working for Time field of ingestion field.
What you expected to happen:
The time series visualization need to work as per the data.timestamp field and dont need to work on Time field in opensearch.
How to reproduce it (as minimally and precisely as possible):
Ingest some logs according the following criteria and check. The timestamp field values are not organized in desc or asc its mixed like the following way.
Time data.timestamp
Jul 22, 2024 @ 23:54:23.433 Jul 22, 2024 @ 23:45:27.784
Jul 22, 2024 @ 23:54:23.177 Jul 22, 2024 @ 23:45:31.602
Jul 22, 2024 @ 23:54:19.967 Jul 22, 2024 @ 23:47:58.090
Jul 22, 2024 @ 23:54:17.367 Jul 22, 2024 @ 23:50:17.581
Jul 22, 2024 @ 23:54:17.108 Jul 22, 2024 @ 23:50:40.333
Jul 22, 2024 @ 23:54:16.365 Jul 22, 2024 @ 23:51:13.119
Jul 22, 2024 @ 23:54:14.256 Jul 22, 2024 @ 23:52:02.211
Jul 22, 2024 @ 23:54:12.766 Jul 22, 2024 @ 23:53:13.873
Anything else we need to know?:
I need to create a time series visualization using the data.timestamp with counts.
Current issue: If i mention the data histogram as data.timestamp also its working by default for Time field in grafana.

Environment: Prod

  • Grafana version: 10.4.1
  • OpenSearch version: 2.11
  • Plugin version: 2.14.7
  • Plugin API version: grafana-opensearch-datasource/versions/2.14.7/download
@kevinwcyu
Copy link
Contributor

Hi @SricharanSundar, just wanted to clarify the problem. You have logs where there are two fields that are time data types, timestamp and Time, where timestamp is the field you want the visualization to use and Time is a field that represents when the log was ingested? Is that correct?

What do you have set for the Time field name in your OpenSearch data source configuration?

@kevinwcyu kevinwcyu moved this from Incoming to Waiting in AWS Datasources Jul 24, 2024
@SricharanSundar
Copy link
Author

SricharanSundar commented Jul 24, 2024 via email

@kevinwcyu
Copy link
Contributor

Hi @SricharanSundar,

What do you have set for the Time field name in your OpenSearch data source configuration?

@SricharanSundar
Copy link
Author

Hi @SricharanSundar,

What do you have set for the Time field name in your OpenSearch data source configuration?

"data": {
"properties": {
"aggregate_id": {
"type": "text"
},
"container_id": {
"type": "keyword"
},
"data_center": {
"type": "keyword"
},
"timestamp": {
"type": "date_nanos"
},

@kevinwcyu kevinwcyu moved this from Waiting to Incoming in AWS Datasources Sep 11, 2024
@iwysiu
Copy link
Contributor

iwysiu commented Sep 18, 2024

Hi @SricharanSundar ! In the datasource configuration in Grafana, do you have Time field name set to data.timestamp? Below is a picture where the time field is set to order_date.
Image

@iwysiu iwysiu moved this from Incoming to Waiting in AWS Datasources Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasource/OpenSearch type/bug Something isn't working
Projects
Status: Waiting
Development

No branches or pull requests

3 participants