20 Dec 2024 04:47 PM - edited 27 Dec 2024 11:24 AM
Let me share some things I've often encountered when talking to you.
I'll also use this to tie it back to some of the improvements we shipped, ship or that might wait for you next year
Use the Getting Started dashboard or notebook, particularly the links to the Dynatrace Playground environment, to find examples with variations for common visualization types such as Graph, Single value, Pie/Donut, and more.
Regardless of the visualization type, sometimes you want to change a unit, or the decimals.
There is more you can do with Units and formats. For example, you can find it in the Visual tab in Dashboards.
Example 1 - Select the (base) unit
Revenue over time
What if I now want decimals?
Go to units and formats (or search, which will get to your environments with 1.306, the next release).
Create a new mapping
Choose the unit that the number is in
Pick the number of decimals
Voila....
Example 2 - Transform to another (display) unit
For example, if your numbers are byte-based, some prefer to look at them with base 2 or base 10.
Start with Unit "Byte" (neutral)
Now, pick your desired base by selecting Gibibyte (GiB) or Gigabyte (GB), and we will transform it for you!
or
Improvements?
What we know and will improve next year:
What if you want to repeatedly use (join, correlate,..) the same data in multiple tiles and their DQL statements?
Let's create a health tile for Kubernetes nodes and make the input data (nodes) dynamic via a hidden variable that might be used in multiple tiles.
1. Provide the data - Create a DQL tile and use the following query, which joins meta information for Kubernetes nodes with active problems
fetch dt.entity.kubernetes_node
| lookup [
fetch dt.davis.problems
| filter event.status == "ACTIVE"
| expand affected_entity_ids
], sourceField:id, lookupField:affected_entity_ids
| fields
id,
`dt.entity.kubernetes_node.name` = entity.name,
`active problems`= if(isNotNull(lookup.affected_entity_ids),
"active problem", else: "healthy"), `problem id`= lookup.display_id
2. Map the data - Go to the "Visual" tab, open the "Data mapping" section, and select "active problems."
3. Tailor
Legend - Go to the "Legend and tooltip" section. De-select all entries in the dropdown and then only select the respective name of the entity to display the name.
Colors - encode the states using color like
This should produce a working health tile for your Kubernetes nodes
At this point to replicate this for other entity types, it's as easy as replacing the entity type in the first line where it says fetch dt.entity..... For example, I could easily replace dt.entity.kubernetes_node with dt.entity.kubernetes_cluster. Adjust the visual settings above and get.
4. Make the input dynamic with a hidden variable
4.1 create the fetch call dynamically in a new DQL variable $node with the query:
fetch dt.entity.kubernetes_node
| fields id
and replace our initial query with:
data record(dt.entity.kubernetes_node=array($node))
| expand dt.entity.kubernetes_node
| lookup [
fetch dt.davis.problems
| filter event.status == "ACTIVE"
| expand affected_entity_ids
], sourceField:dt.entity.kubernetes_node, lookupField:affected_entity_ids
| fields
dt.entity.kubernetes_node,
`dt.entity.kubernetes_node.name` = entityName(dt.entity.kubernetes_node),
`active problems`= if(isNotNull(lookup.affected_entity_ids), "active problem", else: "healthy"),
`problem id`= lookup.display_id,
`event id`= lookup.event.id
We changed our initial...
Would we now replicate the tile and, for example, show a table with other additional entity information next to the initial honeycomb? We could now use the same first lines and, this way, hold these two in sync. Any changes needed on the initial input data can be made in the variable $node. The change and results would be immediately reflected in both tiles that use the hidden variable $node. For example, if you want to constrain the result of your health information to a certain team, the infrastructure area throughout multiple tiles is a non-changeable way for your dashboard consumers.
While we're working on the tile and section template for all health tiles, let me share 99% of the work in the following dashboard on the Playground for multiple health tile variants. Use any of the examples by copying and pasting them to your dashboards with the keyboard shortcuts "CMD/CTRL + C" on the Playground example and "CMD/CTRL + V" on your own dashboard.
Alternatively, copy and paste the base code for a service health tile from below.
{"tiles":{"0":{"type":"data","title":"Services","query":"fetch dt.entity.service\n| lookup [\n fetch dt.davis.problems\n | filter event.status == \"ACTIVE\"\n | expand affected_entity_ids\n], sourceField:id, lookupField:affected_entity_ids\n| fields \n id, \n name = entity.name,\n `active problems`= if(isNotNull(lookup.affected_entity_ids), \"active problem\", else: \"healthy\"),\n problem.id= lookup.display_id,\n event.id= lookup.event.id","davis":{"enabled":false,"davisVisualization":{"isAvailable":true}},"visualization":"honeycomb","visualizationSettings":{"thresholds":[],"chartSettings":{"xAxisScaling":"analyzedTimeframe","gapPolicy":"connect","circleChartSettings":{"groupingThresholdType":"relative","groupingThresholdValue":0,"valueType":"relative"},"categoryOverrides":{},"curve":"linear","pointsDisplay":"auto","categoricalBarChartSettings":{"categoryAxisLabel":"id,name,active problems","valueAxisLabel":"","tooltipVariant":"single","categoryAxis":["id","name","active problems"],"valueAxis":[]},"hiddenLegendFields":[],"truncationMode":"middle"},"singleValue":{"showLabel":true,"label":"error","prefixIcon":"","autoscale":true,"alignment":"center","colorThresholdTarget":"value","recordField":"error","trend":{"trendType":"auto","isVisible":true}},"table":{"rowDensity":"condensed","enableSparklines":false,"hiddenColumns":[],"linewrapEnabled":false,"lineWrapIds":[],"monospacedFontEnabled":false,"monospacedFontColumns":[],"columnWidths":{"[\"entity.name\"]":269.09375},"columnTypeOverrides":[]},"honeycomb":{"shape":"hexagon","legend":{"hidden":false,"position":"auto"},"colorMode":"custom-colors","colorPalette":"categorical","dataMappings":{"value":"active problems"},"displayedFields":["name"],"customColors":[{"id":0,"value":"healthy","comparator":"=","color":{"Default":"var(--dt-colors-charts-categorical-themed-swamps-color-01-default, #006650)"}},{"id":577652.3999999985,"value":"active problem","comparator":"=","color":{"Default":"var(--dt-colors-charts-categorical-color-12-default, #cd3741)"}}],"truncationMode":"middle"},"histogram":{"dataMappings":[],"variant":"single","displayedFields":["id","active problems"]},"autoSelectVisualization":false},"timeframe":{"tileTimeframeEnabled":false,"tileTimeframe":{"from":"now()-7d","to":"now()"}},"querySettings":{"maxResultRecords":1000,"defaultScanLimitGbytes":500,"maxResultMegaBytes":1,"defaultSamplingRatio":10,"enableSampling":false}}},"layouts":{"0":{"x":0,"y":5,"w":7,"h":6}},"variables":[],"variableValues":{}}