- onChange({
- ...value,
- url: newValue,
- })
- }
- suggestions={suggestions}
- />
- }
- className={css`
- width: 100%;
- `}
- />
+
+
+ onChange({
+ ...value,
+ url: newValue,
+ })
+ }
+ suggestions={suggestions}
+ />
+ }
+ className={styles.urlField}
+ />
+
+
{
name: 'trace2',
url: 'test',
datasourceUid: 'uid2',
+ urlDisplayLabel: 'Custom Label',
},
],
});
@@ -279,7 +280,7 @@ describe('enhanceDataFrame', () => {
url: '',
});
expect(fc.getFieldByName('trace2')!.config.links![1]).toEqual({
- title: '',
+ title: 'Custom Label',
internal: { datasourceName: 'Loki1', datasourceUid: 'uid2', query: { query: 'test' } },
url: '',
});
diff --git a/public/app/plugins/datasource/loki/result_transformer.ts b/public/app/plugins/datasource/loki/result_transformer.ts
index 503a77e5195..817ee1066d2 100644
--- a/public/app/plugins/datasource/loki/result_transformer.ts
+++ b/public/app/plugins/datasource/loki/result_transformer.ts
@@ -427,7 +427,7 @@ function fieldFromDerivedFieldConfig(derivedFieldConfigs: DerivedFieldConfig[]):
acc.push({
// Will be filled out later
- title: '',
+ title: derivedFieldConfig.urlDisplayLabel || '',
url: '',
// This is hardcoded for Jaeger or Zipkin not way right now to specify datasource specific query object
internal: {
@@ -439,7 +439,7 @@ function fieldFromDerivedFieldConfig(derivedFieldConfigs: DerivedFieldConfig[]):
} else if (derivedFieldConfig.url) {
acc.push({
// We do not know what title to give here so we count on presentation layer to create a title from metadata.
- title: '',
+ title: derivedFieldConfig.urlDisplayLabel || '',
// This is hardcoded for Jaeger or Zipkin not way right now to specify datasource specific query object
url: derivedFieldConfig.url,
});
diff --git a/public/app/plugins/datasource/loki/types.ts b/public/app/plugins/datasource/loki/types.ts
index 0b751fb73f5..ad5f705a006 100644
--- a/public/app/plugins/datasource/loki/types.ts
+++ b/public/app/plugins/datasource/loki/types.ts
@@ -112,6 +112,7 @@ export type DerivedFieldConfig = {
matcherRegex: string;
name: string;
url?: string;
+ urlDisplayLabel?: string;
datasourceUid?: string;
};