MetricsDrilldown: Update name of queryless metrics experience (#100675)
* Chore: Update copy and comments to refer to Metrics Drilldown * chore: replace explore-metrics with metrics-drilldown in api.ts * chore: replace explore-metrics with metrics-drilldown in a pi.test.ts * chore: rename remaining instances in /public/app/features/trails * Update public/app/features/trails/Integrations/dashboardIntegration.ts Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com> * Update public/app/features/trails/Integrations/dashboardIntegration.ts Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com> --------- Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>
This commit is contained in:
co-authored by
Nick Richmond
parent
9de769318c
commit
95c05a1df9
@@ -86,7 +86,7 @@ export {
|
||||
} from './types';
|
||||
export { PrometheusVariableSupport } from './variables';
|
||||
|
||||
// For explore metrics
|
||||
// For Metrics Drilldown
|
||||
export { default as PromQlLanguageProvider } from './language_provider';
|
||||
export { getPrometheusTime } from './language_utils';
|
||||
export { isValidLegacyName, utf8Support, wrapUtf8Filters } from './utf8_support';
|
||||
|
||||
@@ -61,7 +61,7 @@ export async function addDataTrailPanelAction(dashboard: DashboardScene, panel:
|
||||
|
||||
if (subMenu.length > 0) {
|
||||
items.push({
|
||||
text: 'Explore metrics',
|
||||
text: 'Metrics drilldown',
|
||||
iconClassName: 'code-branch',
|
||||
subMenu: getUnique(subMenu),
|
||||
});
|
||||
@@ -109,7 +109,7 @@ function createCommonEmbeddedTrailStateProps(item: QueryMetric, dashboard: Dashb
|
||||
|
||||
const commonProps = {
|
||||
scene: embeddedTrail,
|
||||
title: 'Explore metrics',
|
||||
title: 'Metrics drilldown',
|
||||
};
|
||||
|
||||
return commonProps;
|
||||
|
||||
@@ -80,7 +80,7 @@ export class AddToExplorationButton extends SceneObjectBase<AddToExplorationButt
|
||||
return;
|
||||
}
|
||||
const ctx = {
|
||||
origin: 'Explore Metrics',
|
||||
origin: 'Metrics Drilldown',
|
||||
type: 'timeseries',
|
||||
queries,
|
||||
timeRange: { ...timeRange.state.value },
|
||||
|
||||
@@ -578,7 +578,7 @@ export class MetricSelectScene extends SceneObjectBase<MetricSelectSceneState> i
|
||||
},
|
||||
...Array.from(rootGroup?.groups.keys() ?? []).map((g) => ({ label: `${g}_`, value: g })),
|
||||
]}
|
||||
className="explore-metrics-metric-prefix-select"
|
||||
className="metrics-drilldown-metric-prefix-select"
|
||||
/>
|
||||
</Field>
|
||||
{!metric && hasOtelResources && (
|
||||
|
||||
@@ -57,7 +57,7 @@ export async function getMetricNamesWithoutScopes(
|
||||
...(limit ? { limit } : {}),
|
||||
};
|
||||
|
||||
const response = await getBackendSrv().get<SuggestionsResponse>(url, params, 'explore-metrics-names');
|
||||
const response = await getBackendSrv().get<SuggestionsResponse>(url, params, 'metrics-drilldown-names');
|
||||
|
||||
if (limit && response.warnings?.includes(LIMIT_REACHED)) {
|
||||
return { ...response, limitReached: true, missingOtelTargets };
|
||||
@@ -82,7 +82,7 @@ export async function getMetricNamesWithScopes(
|
||||
filters,
|
||||
'__name__',
|
||||
limit,
|
||||
'explore-metrics-names'
|
||||
'metrics-drilldown-names'
|
||||
);
|
||||
|
||||
if (jobs.length > 0 && instances.length > 0) {
|
||||
|
||||
@@ -154,7 +154,7 @@ export class MetricDatasourceHelper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for additional filtering for adhoc vars labels in Explore metrics.
|
||||
* Used for additional filtering for adhoc vars labels in Metrics Drilldown.
|
||||
* @param options
|
||||
* @returns
|
||||
*/
|
||||
@@ -170,7 +170,7 @@ export class MetricDatasourceHelper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for additional filtering for adhoc vars label values in Explore metrics.
|
||||
* Used for additional filtering for adhoc vars label values in Metrics Drilldown.
|
||||
* @param options
|
||||
* @returns
|
||||
*/
|
||||
|
||||
@@ -30,10 +30,10 @@ jest.mock('@grafana/runtime', () => ({
|
||||
requestId?: string,
|
||||
options?: Partial<BackendSrvRequest>
|
||||
) => {
|
||||
// explore-metrics-otel-resources
|
||||
// metrics-drilldown-otel-resources
|
||||
if (
|
||||
requestId === 'explore-metrics-otel-check-total-count(target_info{}) by (job, instance)' ||
|
||||
requestId === 'explore-metrics-otel-check-total-count(metric) by (job, instance)'
|
||||
requestId === 'metrics-drilldown-otel-check-total-count(target_info{}) by (job, instance)' ||
|
||||
requestId === 'metrics-drilldown-otel-check-total-count(metric) by (job, instance)'
|
||||
) {
|
||||
return Promise.resolve({
|
||||
data: {
|
||||
@@ -43,17 +43,17 @@ jest.mock('@grafana/runtime', () => ({
|
||||
],
|
||||
},
|
||||
});
|
||||
} else if (requestId === 'explore-metrics-otel-resources-deployment-env') {
|
||||
} else if (requestId === 'metrics-drilldown-otel-resources-deployment-env') {
|
||||
return Promise.resolve({ data: ['env1', 'env2'] });
|
||||
} else if (
|
||||
requestId ===
|
||||
'explore-metrics-otel-resources-metric-job-instance-metric{job=~"job1|job2",instance=~"instance1|instance2"}'
|
||||
'metrics-drilldown-otel-resources-metric-job-instance-metric{job=~"job1|job2",instance=~"instance1|instance2"}'
|
||||
) {
|
||||
// part of getFilteredResourceAttributes to get metric labels. We prioritize metric labels over resource attributes so we use these to filter
|
||||
return Promise.resolve({ data: ['promotedResourceAttribute'] });
|
||||
} else if (
|
||||
requestId ===
|
||||
'explore-metrics-otel-resources-metric-job-instance-target_info{job=~"job1|job2",instance=~"instance1|instance2"}'
|
||||
'metrics-drilldown-otel-resources-metric-job-instance-target_info{job=~"job1|job2",instance=~"instance1|instance2"}'
|
||||
) {
|
||||
// part of getFilteredResourceAttributes to get instance labels
|
||||
return Promise.resolve({ data: ['promotedResourceAttribute', 'resourceAttribute'] });
|
||||
|
||||
@@ -56,7 +56,7 @@ export async function totalOtelResources(
|
||||
const responseTotal = await getBackendSrv().get<OtelResponse>(
|
||||
url,
|
||||
paramsTotalTargets,
|
||||
`explore-metrics-otel-check-total-${query}`
|
||||
`metrics-drilldown-otel-check-total-${query}`
|
||||
);
|
||||
|
||||
let jobs: string[] = [];
|
||||
@@ -127,7 +127,7 @@ export async function getDeploymentEnvironmentsWithoutScopes(
|
||||
const response = await getBackendSrv().get<LabelResponse>(
|
||||
url,
|
||||
params,
|
||||
'explore-metrics-otel-resources-deployment-env'
|
||||
'metrics-drilldown-otel-resources-deployment-env'
|
||||
);
|
||||
|
||||
// exclude __name__ or previously chosen filters
|
||||
@@ -162,7 +162,7 @@ export async function getDeploymentEnvironmentsWithScopes(
|
||||
],
|
||||
'deployment_environment',
|
||||
undefined,
|
||||
'explore-metrics-otel-resources-deployment-env'
|
||||
'metrics-drilldown-otel-resources-deployment-env'
|
||||
);
|
||||
// exclude __name__ or previously chosen filters
|
||||
return response.data.data;
|
||||
@@ -230,7 +230,7 @@ export async function getFilteredResourceAttributes(
|
||||
const metricResponse = await getBackendSrv().get<LabelResponse>(
|
||||
url,
|
||||
metricParams,
|
||||
`explore-metrics-otel-resources-metric-job-instance-${metricMatchParam}`
|
||||
`metrics-drilldown-otel-resources-metric-job-instance-${metricMatchParam}`
|
||||
);
|
||||
// the metric labels here
|
||||
const metricLabels = metricResponse.data ?? [];
|
||||
@@ -249,7 +249,7 @@ export async function getFilteredResourceAttributes(
|
||||
const targetInfoResponse = await getBackendSrv().get<LabelResponse>(
|
||||
url,
|
||||
targetInfoParams,
|
||||
`explore-metrics-otel-resources-metric-job-instance-${targetInfoMatchParam}`
|
||||
`metrics-drilldown-otel-resources-metric-job-instance-${targetInfoMatchParam}`
|
||||
);
|
||||
|
||||
const targetInfoAttributes = targetInfoResponse.data ?? [];
|
||||
@@ -294,7 +294,7 @@ export async function getNonPromotedOtelResources(datasourceUid: string, timeRan
|
||||
const targetInfoResponse = getBackendSrv().get<LabelResponse>(
|
||||
url,
|
||||
targetInfoParams,
|
||||
`explore-metrics-all-otel-resources-on-target_info`
|
||||
`metrics-drilldown-all-otel-resources-on-target_info`
|
||||
);
|
||||
|
||||
// all labels in all metrics
|
||||
@@ -311,7 +311,7 @@ export async function getNonPromotedOtelResources(datasourceUid: string, timeRan
|
||||
const metricResponse = await getBackendSrv().get<LabelResponse>(
|
||||
url,
|
||||
metricParams,
|
||||
`explore-metrics-all-metric-labels-not-otel-resource-attributes`
|
||||
`metrics-drilldown-all-metric-labels-not-otel-resource-attributes`
|
||||
);
|
||||
const promResponses = await Promise.all([targetInfoResponse, metricResponse]);
|
||||
// otel resource attributes
|
||||
|
||||
@@ -548,7 +548,7 @@ function checkLabelPromotion(filters: AdHocVariableFilter[], nonPromotedOtelReso
|
||||
* Once we know this, we can add the selected filter to either the
|
||||
* VAR_OTEL_RESOURCES or VAR_FILTERS variable.
|
||||
*
|
||||
* When the correct variable is updated, the rest of the explore metrics behavior will remain the same.
|
||||
* When the correct variable is updated, the rest of the Metrics Drilldown behavior will remain the same.
|
||||
*
|
||||
* @param newStateFilters
|
||||
* @param prevStateFilters
|
||||
|
||||
Reference in New Issue
Block a user