Creating a timeseries graph with nested timestamp values

Dear all,

  • What Grafana version and what operating system are you using?
    Grafana 7.5.2

  • What are you trying to achieve?
    I have an elasticsearch index with some docs having 2 fixed metrics and one metric changing with time. The index looks like this:
    {
    “_index” : “timeseries_ind”,
    “_type” : “_doc”,
    “_id” : “c7IY74IBjASA87Oy-d2C”,
    “_score” : 1.0,
    “_source” : {
    “metric1” : “test”,
    “metric2” : “project_test”,
    “data” : [
    {
    “metric3” : 520.4,
    “timestamp” : 1631541600000
    },
    {
    “metric3” : 570.4,
    “timestamp” : 1631451600000
    }
    ]
    }
    }
    ]
    }
    In this example, we have only 2 timestamps but in a real case, we have 1000s of timestamps. So we decided to group our data like this

  • How are you trying to achieve it?
    I am trying to create a grafana dashboard and plot a timeseries graph for metric3.
    In the index configuration in Grafana, I chose “data.timestamp” in “Time field name” and I see no error.
    When trying to plot the graph, I chose data.metric3 and data.timestamp but I see nothing. Even the query returns no values. (see screenshot)

Am I missing something and is there a specific configuration to make this work

  • What happened?
    I see empty plots and the query returns nothing

  • What did you expect to happen?
    The data to be plotted

Welcome,

What happens if you changed the grafana time filter to 2 years ago

still the same. I don’t see anything and there are no data in the query

oh wait, I do not see any value in the value column why is that? what is the data type of metric3 in elastic search

“metric3”: {
“type”: “float”
},

If I create a second index with the same metrics but not nested timestamp, it works. It only doesn’t work with the nested timestamps.

for e.g
“hits” : [
{
“_index” : “timeseries_ind2”,
“_type” : “_doc”,
“_id” : “drJh74IBjASA87Oy591o”,
“_score” : 1.0,
“_source” : {
“metric1” : “test”,
“metric2” : “project_test”,
“metric3” : 570.4,
“timestamp” : 1631451600000
}
},
{
“_index” : “timeseries_ind2”,
“_type” : “_doc”,
“_id” : “dLJh74IBjASA87OybN2g”,
“_score” : 1.0,
“_source” : {
“metric1” : “test”,
“metric2” : “project_test”,
“metric3” : 520.4,
“timestamp” : 1631541600000
}
}
]

any other suggestions?