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

DQL: filter by ZONE

yuval1983
Guide

 

 

HI,

I created this filter, and I want to add another filter in addition that I can see by ZONE

 

yuval1983_1-1703667962158.png

I can Search but the list to long so i what to add another filer

yuval1983_0-1703667940775.png

 

can you help 🙂

9 REPLIES 9

yuval1983
Guide

yuval1983_0-1703669279394.png

I did it this way

But he doesn't cut and filter for the big list

Hi,

Do you need something like this?

Pawel_Zalewski_0-1703670909160.png

 

"The lions does not ally with the coyotes"

Or like this

Pawel_Zalewski_0-1703671236213.png

 

"The lions does not ally with the coyotes"

 thanks 🙂

yuval1983_0-1703680472481.jpeg

How can I fix this?


And How I add a Tags filter ?

In the category "Properties and tags"
I made an association based on Tags

Can you post whole query?

"The lions does not ally with the coyotes"

To filter a tag you just need something like this:

fetch dt.entity.service
| fields entity.name, managementZones, tags
| filter matchesValue(tags, "TAG you looking for")

"The lions does not ally with the coyotes"

 

 

HI,

 

/*
 * This function will run in the DYNATRACE JavaScript runtime.
 * For information, visit https://dt-url.net/functions-help
 */
import { metricsClient } from '@dynatrace-sdk/client-classic-environment-v2';

export default async function fetchMetricResults() {
  const serviceSelection = $Service;
  const metricKey = "builtin:service.errors.total.rate";

  const config = {
    metricSelector: buildQuery(serviceSelection, metricKey),
    resolution: "Inf",
    from: $dt_timeframe_from,
    to: $dt_timeframe_to,
    acceptType: "application/json; charset=utf-8"
  };

  if (config.metricSelector.length > 3500) {
    return "Please select fewer services";
  }

  const metricQuery = await metricsClient.query(config);

  const processedResults: MetricResult[] = metricQuery.result[0].data.map(result => {
    return {
      "Service Name": result.dimensionMap["dt.entity.service.name"],
      "Service ID": result.dimensionMap["dt.entity.service"],
      "Failure Rate": +result.values
    };
  });

  return processedResults;
}

function buildQuery(inputs: string[], metricKey: string): string {
  const filters = inputs.map(
    input => `in("dt.entity.service", entitySelector("type(service), entityName.equals(~"${input}~")"))`
  );
  const filterString = filters.join(",");

  return `${metricKey}:filter(or(${filterString})):splitBy("dt.entity.service"):sort(value(auto, descending)):names`;
}

 

 

I have an example code that I want to add Zone filter capabilities to in the Failure Rate window. This means that in addition to the current filters for *prod OR *QA  OR *Test, I would like to add another filter for location, such as *US OR *UK. The purpose of these filters is to be able to narrow down the results by location or name. Thank you  your assistance.

Sorry but I can't find any solutions for this problem 😕

"The lions does not ally with the coyotes"

OK - maybe it sounds too complicated - i try explain

This is my screen

yuval1983_1-1704621349618.png

 

I want to add in the area of ​​the filter
Column filter
Enables/disables field filters in table
Then the result will be in the window

- I want to add TAGS:PROD - 

The code found in average is like this

 

import { metricsClient } from '@dynatrace-sdk/client-classic-environment-v2';

export default async function fetchMetricResults() {
  const serviceSelection = $Service;
  const metricKey = "builtin:service.errors.total.rate";

  const config = {
    metricSelector: buildQuery(serviceSelection, metricKey),
    resolution: "Inf",
    from: $dt_timeframe_from,
    to: $dt_timeframe_to,
    acceptType: "application/json; charset=utf-8"
  };

  if (config.metricSelector.length > 3500) {
    return "Please select fewer services";
  }

  const metricQuery = await metricsClient.query(config);

  const processedResults: MetricResult[] = metricQuery.result[0].data.map(result => {
    return {
      "Service Name": result.dimensionMap["dt.entity.service.name"],
      "Service ID": result.dimensionMap["dt.entity.service"],
      "Failure Rate": +result.values
    };
  });

  return processedResults;
}

function buildQuery(inputs: string[], metricKey: string): string {
  const filters = inputs.map(
    input => `in("dt.entity.service", entitySelector("type(service), entityName.equals(~"${input}~")"))`
  );
  const filterString = filters.join(",");

  return `${metricKey}:filter(or(${filterString})):splitBy("dt.entity.service"):sort(value(auto, descending)):names`;
}

The window shows me only the first filter - I want to add another filtering filter

 


@Pawel_Zalewski wrote:

Sorry but I can't find any solutions for this problem 😕


 

Featured Posts