I am trying to create a dashboard that will contain links to other websites. I know that this can be achieved by using the “markup” selection when defining a new section. But is it possible to do the same with the “code” option? If so, then I do I go about doing this?
Hi, Yes I understand that markdown tiles are built for this purpose, but I have a use case that requires me to extract data from Dynatrace, display this data, together with a URL that will dynamically change based on the value returned. Since the markdown tile cannot be used to query the data from Dynatrace, I have to use the code block for this. Is there any way that I can achieve?
I would like to populate links to an external webpage ideally using the Code block and not the markup block. The reason for this is becuase I am pulling some SLO metrics in Dynatrace, and need to have an associated link to an external application for each of this lines. Here is a sample of what I am trying to achieve
The issue that I have is that If I specify the link in a column in the table, When click on the link and open, I get the message that I dont have any compatible apps.
The only other way that I think that I can get this to work is by creating an app for this using AppEngine, but this is a mission and a half.
I’ve checked and even hardcoding the URL does not open to corresponding webpage due the the screenshots you put above. Can you PM me the JS you are running, removing the links and just putting Google.com for reference?
This works with HostID > Hosts, ServiceId > Services etc but the external links do not open on a table.
I have raised a Dynatrace RFE, but the link opening may be disabled for security reasons, i’ll check internally.
Here is an example of the code and what I am trying to achieve. I believe that you already understand the use case that I have. Many thanks for also raising the RFE.
import { serviceLevelObjectivesClient } from "@dynatrace-sdk/client-classic-environment-v2";
import { Markdown } from '@dynatrace/strato-components-preview/content';
export default async function () {
var slos = [["1f943f42-0462-3d00-b64e-3b045e4489b7","https://www.google.com"],["d473cbc5-6862-3abd-87b1-18da5c1a11d3","https://www.dynatrace.com"]];
var arr = new Array();
var nextpage = "Start";
for (let h = 0; h < slos.length;h++)
{
var data = await serviceLevelObjectivesClient.getSlo({evaluate: true,sloSelector: "id("+slos[h][0]+")"});
for (let i = 0; i < data.slo.length; i++)
{
var slometrics = data.slo[i];
let Basic = new URL(slos[h][1]);
if (slometrics.errorBudgetBurnRate.sloValue != null){
arr.push({name: slometrics.name, slo: slometrics.errorBudgetBurnRate.sloValue, "error Budget Variance": slometrics.errorBudget, target: slometrics.target, url: Basic});
}
}
}
return arr;
}
I hope that the above code provides further insight.
What we are currently working on is simply offering an “Open link” action on the table, which IMHO is 80% of the way to a proper solution. Hopefully, this will make it into 1.283 (January)
The next logical step is to allow you to show a beautified link text.
Sorry not sure I understood, can I use code execution to have a clickable link in a table visualization today or no? I’m eager to get clickable links in my dashboards!
With 1.283 yes. It doesn’t matter whether it is code, build or a query tile or section. As long as a valid https links is the value of the cell we will provide a “open link” cell action. :). So yes