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

URLs in New Dashboards

AmitChiba
Helper

Hi,

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?

20 REPLIES 20

radek_jasinski
DynaMight Guru
DynaMight Guru

Hi @AmitChiba 

The Markdown tile is designed for this:

Zrzut ekranu 2023-11-27 o 09.53.01.png

Example: [link](https://dynatrace.com)

Radek

Have a nice day!

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 do not know if such functionality is available. I will check on my environment.

However, I do not exclude the possibility that you may have to report Product Idea.

Have a nice day!

zietho
Dynatrace Leader
Dynatrace Leader

What about creating a code-based query. 

I have a simple CSV based example here (Example 5): 

I defined a variable on top that has two strings 

zietho_0-1701961005901.png

and in the markdown I use the value in both the text as well as in the actual underlying URL. 

zietho_1-1701961038524.png

https://wkf10640.apps.dynatrace.com/ui/apps/dynatrace.dashboards/dashboard/30a2fd95-90e8-40d8-8387-d... 

LawrenceBarratt
Dynatrace Advisor
Dynatrace Advisor

Hi @AmitChiba .

Can you elaborate on what links you'd like to populate, and to what condition they would be populated from?

Thank you,

Lawrence

Hi @LawrenceBarratt ,

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

AmitChiba_0-1702023849162.png

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.

Do you have any other suggestions?

Kind Regards,
Amit

LawrenceBarratt
Dynatrace Advisor
Dynatrace Advisor

Hi @AmitChiba 

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.

https://developer.dynatrace.com/reference/javascript-runtime/#web-apis

Thanks,

Lawrence

Hi @LawrenceBarratt ,

 

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.

 

Thank you

Kind Regards,

Amit

zietho
Dynatrace Leader
Dynatrace Leader

This sounds like you want to create and expose dynamic links in a table. Or which visualization would you want to use for showing such links? 

The table is the only visualization that I would like to expose this on.

zietho
Dynatrace Leader
Dynatrace Leader

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.

For example,

This is brilliant. Thanks for the update. For now, having it functional is good enough for me to achieve my objective. 

Many thanks

Regards,

Amit

zietho
Dynatrace Leader
Dynatrace Leader

Spoiler alert!

looks (reached out to the team and seems we already managed to do it in 1.283) like:

zietho_0-1702479407161.png

 

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!

zietho
Dynatrace Leader
Dynatrace Leader

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 

Hi @zietho ,

Do you know if  it managed to make the V1.283 build? My instance was upgraded last night, but I dont see the option to open link.

 

Thank you

Regards,

Amit

zietho
Dynatrace Leader
Dynatrace Leader

Have you added https://… or http:// we only offer it if the column contains a true links with a prefix of a protocol. 

Yes I have prefixed it with the protocol.

 

AmitChiba_0-1705680118998.png

This is the grail query

data record(url="https://www.google.com")

Hi All, 

This now resolved. Thank you very much for the assistance.

Hi @zietho,

The "open link" and "copy" menu opens only for users with edit permission on dashboard. Is there a way to allow view-only users to use these links?

Regards,
Deepak

Featured Posts