diff --git a/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx b/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx
index 9b3791e062..4322bba10b 100644
--- a/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx
+++ b/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx
@@ -107,10 +107,15 @@ const NewRelicFetchComponent: FC<{}> = () => {
const configApi = useApi(configApiRef);
const apiBaseUrl = configApi.getString('newrelic.api.baseUrl');
const apiKey = configApi.getString('newrelic.api.key');
+ const apiKeyIsSet = apiKey && apiKey !== 'NEW_RELIC_REST_API_KEY';
const { value, loading, error } = useAsync(async (): Promise<
NewRelicApplication[]
> => {
+ if (!apiKeyIsSet) {
+ return [];
+ }
+
const response = await fetch(`${apiBaseUrl}/applications.json`, {
headers: {
'X-Api-Key': apiKey,
@@ -126,6 +131,12 @@ const NewRelicFetchComponent: FC<{}> = () => {
return ;
} else if (error) {
return {error.message};
+ } else if (!apiKeyIsSet) {
+ return (
+
+ No REST API Key configured. Check your app-config.yaml.
+
+ );
}
return ;