I need help in Implementing Opensearch data to Grafana visualisation

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

  • What are you trying to achieve?
    I am very new to Grafana and tried multiple ways to deal with my requirement and couldn’t succeed , Here is now hoping to know is it even achiavable with the kind of data that I indexed in OpenSearch .
    I have fields with keyword datatype as issue_id,priority,team and date field which is also time field for the index that is created_time and another one end_time , Also duration_hours (precalculated and indexed the hour in to opensearch as float) .
    Now all I want is to group by team and create_time on x axis where as in y axis I need something called Factor : that is with expression (duration_hours*factor) , the value factor is constant number , it is something like as and when the priority changes the factor number vary . However with duration as metric , I cannot even get the value of it visualise on Grafana (first thing) as it just shows me count,avg,max,min etc . and then No idea on how do I even get to calculate if I cannot even get to see this Duration_hours. Please help!!!
    Even any suggestion to change the index is welcome !

  • How are you trying to achieve it?

  • What happened?
    I cannot even get the value of it visualise on Grafana (first thing) as it just shows me count,avg,max,min etc

  • What did you expect to happen?

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?

Welcome @vydu555

You can take a look at this thread
Can you post what your data looks like a sample json

Hi @yosiasz , Thank you for your response .

{
“_index”: “kpi_jira_3”,
“_id”: “MzpqAIwBKOr0W7E0qjdK”,
“_version”: 25,
“_score”: null,
“_source”: {
“jira_issue_id”: “AAL-157452”,
“created_time”: “2023-11-23 15:30:30”,
“weighted_factor”: 24000,
“id”: “AAL-157452”,
“team”: “exampleTeam”,
“jira_issue_priority”: “Urgent”,
“jira_issue_link”: “https://aallie.atlassian.net/browse/AAL-157452”,
“duration_hours”: 24
},
“fields”: {
“created_time”: [
“2023-11-23T15:30:30.000Z”
]
},
“sort”: [
1700753430000
]
}
This is how my data looks in opensearch , Just so you know I precalculated field duration (in hours ) from field “create_time” and “resolved_time” , and I also pre calculated field weighted_factor , The formula to calculate it was weighted_factor=(constant factor integer ) *(duration) . My initial idea was to calculate weighted_factor in grafana after failing to acheive same , I made it in Opensearch script. My question here is , Is there a possibility that I can calcualte factor in Grafana for my requirement? and Now that I shared my data do you still think I need to use infinity plugin? The requirement is I should able to see weighted_factor of a team per week / month. With my Current data I see this in Grafana .

try using Add field from calculation Transformation

Hi @yosiasz ,

So just to clarify,

Priority has different factors that are constant .

| — | — |
|Business Critical|1000|
|Urgent|100|
|High|30|
|Medium|2|
|Low|1|
factor*duration
A Business Critical incident stays for 2 hours in production: 2 x 1000 = 2000

An Urgent incident stays for two days in production: 2 x 24 x 100 = 4800
and so above are just an example calculations to show how we do .

for that go to infinity and use jsonata for dynamic calculations. doubt you can do this in pure grafana. others might say otherwise

1 Like

Hey again , I think so too ! @yosiasz , Yeah I managed to do all sorts of calculations in Opensearch itself and have the weighted_factor calculated already ,still when I connect to Grafana , Now I have group by teams and create_time ,I cannot figure a way to just display a weighted_factor of team per day/month through any graph . All I see is what I shared in screenshot above. and no other graphs displays any results other than time series.