import { css } from '@emotion/css'; import React from 'react'; import { GrafanaTheme2 } from '@grafana/data'; import { DataSourcePicker } from '@grafana/runtime'; import { Alert, InlineField, useStyles2 } from '@grafana/ui'; import { getDatasourceSrv } from 'app/features/plugins/datasource_srv'; const getStyles = (theme: GrafanaTheme2) => ({ infoText: css` padding-bottom: ${theme.spacing(2)}; color: ${theme.colors.text.secondary}; `, }); interface Props { datasourceUid?: string; onChange: (uid: string) => void; } const xRayDsId = 'grafana-x-ray-datasource'; export function XrayLinkConfig({ datasourceUid, onChange }: Props) { const hasXrayDatasource = Boolean(getDatasourceSrv().getList({ pluginId: xRayDsId }).length); const styles = useStyles2(getStyles); return ( <>

X-ray trace link

Grafana will automatically create a link to a trace in X-ray data source if logs contain @xrayTraceId field
{!hasXrayDatasource && ( )}
onChange(ds.uid)} current={datasourceUid} noDefault={true} />
); }