Add these values

OK

Could you assist me in inserting a value into this code? I am having trouble inserting it in a way that it will filter rather than tag. Below is the code that I have mentioned earlier

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”],
“Tag”:  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,  
“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`;
}