Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitoring: Remove Prometheus UI link and SERVER_FLAGS.*PublicURL entries #9283

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions frontend/@types/console/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ declare interface Window {
prometheusTenancyBaseURL: string;
quickStarts: string;
requestTokenURL: string;
alertManagerPublicURL: string;
grafanaPublicURL: string;
prometheusPublicURL: string;
thanosPublicURL: string;
inactivityTimeout: number;
statuspageID: string;
GOARCH: string;
Expand Down
31 changes: 1 addition & 30 deletions frontend/public/components/monitoring/metrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ import { RootState } from '../../redux';
import { fuzzyCaseInsensitive } from '../factory/table-filters';
import { PrometheusData, PrometheusLabels, PROMETHEUS_BASE_PATH } from '../graphs';
import { getPrometheusURL, PrometheusEndpoint } from '../graphs/helpers';
import { getPrometheusExpressionBrowserURL } from '../graphs/prometheus-graph';
import {
ActionsMenu,
Dropdown,
ExternalLink,
getURLSearchParams,
Kebab,
LoadingInline,
Expand Down Expand Up @@ -186,30 +184,6 @@ const MetricsActionsMenu = connect(
},
)(MetricsActionsMenu_);

const headerPrometheusLinkStateToProps = ({ UI }: RootState) => {
const liveQueries = UI.getIn(['queryBrowser', 'queries']).filter(
(q) => q.get('isEnabled') && q.get('query'),
);
const queryStrings = _.map(liveQueries.toJS(), 'query');
const url = window.SERVER_FLAGS.prometheusPublicURL;
return {
url:
getPrometheusExpressionBrowserURL(url, queryStrings) ||
window.SERVER_FLAGS.prometheusPublicURL,
};
};

const HeaderPrometheusLink_ = ({ url }) => {
const { t } = useTranslation();

return url ? (
<span className="monitoring-header-link">
<ExternalLink href={url} text={t('public~Platform Prometheus UI')} />
</span>
) : null;
};
const HeaderPrometheusLink = connect(headerPrometheusLinkStateToProps)(HeaderPrometheusLink_);

const graphStateToProps = ({ UI }: RootState) => ({
hideGraphs: !!UI.getIn(['monitoring', 'hideGraphs']),
});
Expand Down Expand Up @@ -986,10 +960,7 @@ const QueryBrowserPage_: React.FC<QueryBrowserPageProps> = ({ deleteAll }) => {
</Helmet>
<div className="co-m-nav-title">
<h1 className="co-m-pane__heading">
<span>
{t('public~Metrics')}
<HeaderPrometheusLink />
</span>
<span>{t('public~Metrics')}</span>
<div className="co-actions">
<PollIntervalDropdown />
<MetricsActionsMenu />
Expand Down
1 change: 0 additions & 1 deletion frontend/public/locales/en/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,6 @@
"Collapse all query tables": "Collapse all query tables",
"Expand all query tables": "Expand all query tables",
"Delete all queries": "Delete all queries",
"Platform Prometheus UI": "Platform Prometheus UI",
"Show graph": "Show graph",
"Hide graph": "Hide graph",
"Insert metric at cursor": "Insert metric at cursor",
Expand Down