cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Adding static data to a custom app in Dynatrace

AlexisGND
Helper

Hello,
I've developed a dashboard using a custom NodeJS application to display Dynatrace log data in a table format using DQL. (See screenshots) I want to enhance this dashboard by integrating static data, in the same way that VLOOKUP works in Excel. For example, I want to retrieve the corresponding description for an ID like TestInferface#28_01 to add context to my data. Is there a place in Dynatrace to store this type of static data, given that it needs to be updated daily and accessible from my application ?

AlexisGND_0-1717424437492.png

 

4 REPLIES 4

cesarsaravia
Dynatrace Pro
Dynatrace Pro

Hi @AlexisGND 
I don't exactly know what you are waiting for, but you can store data in custom buckets on Grail. Then retrieve that data using DQL inside of your custom app.
Grail data model - Dynatrace Docs

cesarsaravia_0-1717531279221.png

 

-César S. -

Hi @cesarsaravia thanks for your reply !
In fact, I am already using dql queries to retrieve data in the "logs and events".

Now the idea is to retrieve data from a "static" file that we can store somewhere in the environment. (If possible ?)

This static data contains a column "ID" who is the same with a column "ID" in the "log and events" and the goal is the match them so I can display both columns in the static and "log and events" tables.

 

If it's possible then how ?
If not, I had a suggestion to implement the logic in my custom app to add these additionnal columns but there will be perfomance issues 😞

 

Thanks again for your reply !

sinisa_zubic
Dynatrace Champion
Dynatrace Champion

Hi @AlexisGND 

 

Unfortunately this is currently not possible. But the are "workarounds" to it.

1. option, cascading ifs

 

fetch events 
| fieldsAdd name = if((id==4),"Apple") 
| fieldsAdd name = if((id==4),"Banana", else:name) 
| fieldsAdd name = if((id==4),"Strawberry", else:name) 
| fieldsAdd name = if((id==4),"Watermelon", else:name) 

 

2. option lookup with json structure

 

fetch events
| lookup [data json:"""[
  {
    "id":1,
    "name": "Apple"
  },
  {
    "id":2,
    "name": "Banana"
  },
  {
    "id":3,
    "name": "Strawberry"
  },
  {
    "id":4,
    "name": "Watermelon"
  }
]"""], sourceField: id, lookupField: id

 

 

 

3. option, ingest the data e.g. as (business)events and query it

you can ingest your static data as business events and then join on it as part of your query.

fetch events
| join [
    fetch bizevents, timeframe:"2024-06-06T10:00:00Z/2024-06-06T15:00:00Z"
    | filter table == "mycustomtablename"  
  ], kind:inner, on: { id }, fields: { name }

things to note

* when ingesting the business events, add a unique field (here table) to later easily filter on your data

* specify the timeframe of the join query as the ingest timeframe of your table

* if you need to update your "static" data, you just re-ingest everything again. When you need to query it, you need to re-adjust the timeframe of the join query

 

Best,
Sini

Hello @sinisa_zubic thanks for your reply !
I understand your answer.
By currently making a nodejs app on dynatrace in the "custom apps" for monitoring the logs, it tells me that i can make a json file who contains metadata and make it possible for this custom app to retrieve contexts data by searching on this json file or directly in the query like you did in the second option.

Thanks again 🙂

Regards,
Alexis

Featured Posts