mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 04:22:13 +08:00
Sandbox: Improve logging of sandbox lifecycle for monitoring (#79297)
* Sandbox: Log a plugin loading inside the sandbox * Improve tracking of general sandbox errors * Fix import
This commit is contained in:
@ -3,7 +3,12 @@ import React from 'react';
|
||||
|
||||
import { PluginSignatureType, PluginType } from '@grafana/data';
|
||||
import { LogContext } from '@grafana/faro-web-sdk';
|
||||
import { logWarning as logWarningRuntime, logError as logErrorRuntime, config } from '@grafana/runtime';
|
||||
import {
|
||||
logWarning as logWarningRuntime,
|
||||
logError as logErrorRuntime,
|
||||
logInfo as logInfoRuntime,
|
||||
config,
|
||||
} from '@grafana/runtime';
|
||||
|
||||
import { getPluginSettings } from '../pluginSettings';
|
||||
|
||||
@ -41,6 +46,15 @@ export function logError(error: Error, context?: LogContext) {
|
||||
logErrorRuntime(error, context);
|
||||
}
|
||||
|
||||
export function logInfo(message: string, context?: LogContext) {
|
||||
context = {
|
||||
...context,
|
||||
source: 'sandbox',
|
||||
monitorOnly: String(monitorOnly),
|
||||
};
|
||||
logInfoRuntime(message, context);
|
||||
}
|
||||
|
||||
export async function isFrontendSandboxSupported({
|
||||
isAngular,
|
||||
pluginId,
|
||||
|
Reference in New Issue
Block a user