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

Revert configurable thanos port #1525

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions backend/src/routes/api/prometheus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import { callPrometheusThanos } from '../../../utils/prometheusUtils';
import { createCustomError } from '../../../utils/requestUtils';
import { logRequestDetails } from '../../../utils/fileUtils';
import { THANOS_DEFAULT_OAUTH_PORT } from '../../../utils/constants';

const handleError = (e: createError.HttpError) => {
if (e?.code) {
Expand Down Expand Up @@ -57,7 +56,6 @@ module.exports = async (fastify: KubeFastifyInstance) => {
request,
query,
QueryType.QUERY_RANGE,
THANOS_DEFAULT_OAUTH_PORT,
).catch(handleError);
},
);
Expand Down
3 changes: 0 additions & 3 deletions backend/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,3 @@ export const DEFAULT_NOTEBOOK_SIZES: NotebookSize[] = [

export const imageUrlRegex =
/^([\w.\-_]+((?::\d+|)(?=\/[a-z0-9._-]+\/[a-z0-9._-]+))|)(?:\/|)([a-z0-9.\-_]+(?:\/[a-z0-9.\-_]+|))(?::([\w.\-_]{1,127})|)/;

export const THANOS_DEFAULT_RBAC_PORT = '9092';
export const THANOS_DEFAULT_OAUTH_PORT = '9091';
5 changes: 2 additions & 3 deletions backend/src/utils/prometheusUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
PrometheusQueryRangeResponse,
QueryType,
} from '../types';
import { DEV_MODE, THANOS_DEFAULT_RBAC_PORT } from './constants';
import { DEV_MODE } from './constants';
import { getNamespaces } from './notebookUtils';
import { getDashboardConfig } from './resourceUtils';
import { createCustomError } from './requestUtils';
Expand Down Expand Up @@ -88,13 +88,12 @@ export const callPrometheusThanos = <T>(
request: OauthFastifyRequest,
query: string,
queryType: QueryType = QueryType.QUERY,
port = THANOS_DEFAULT_RBAC_PORT,
): Promise<{ code: number; response: T }> =>
callPrometheus<T>(
fastify,
request,
query,
generatePrometheusHostURL(fastify, 'thanos-querier', 'openshift-monitoring', port),
generatePrometheusHostURL(fastify, 'thanos-querier', 'openshift-monitoring', '9092'),
queryType,
);

Expand Down
Loading