Skip to content

Commit

Permalink
feat: connect to new sqlmesh models for metrics (#2106)
Browse files Browse the repository at this point in the history
* feat: Hasura3 sync to use new metrics schema from sqlmesh

* Remove models that were removed from Clickhouse

* feat: connect to new sqlmesh models for metrics

* Run Hasura3 sync, to reflect the schema fixes in metrics_v0
* Comment out the project level metrics, this still isn't implemented
  yet in the sqlmesh pipeline
* Fix a changed type in the sqlmesh schemas
  • Loading branch information
ryscheng authored Sep 9, 2024
1 parent a7be621 commit a668c44
Show file tree
Hide file tree
Showing 17 changed files with 3,921 additions and 2,110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "@opensource-observer/utils";
import {
GET_TIMESERIES_METRICS_BY_ARTIFACT,
GET_TIMESERIES_METRICS_BY_PROJECT,
//GET_TIMESERIES_METRICS_BY_PROJECT,
} from "../../lib/graphql/queries";
import { eventTimeToLabel } from "../../lib/parsing";
import { RegistrationProps } from "../../lib/types/plasmic";
Expand Down Expand Up @@ -319,7 +319,8 @@ function MetricsDataProvider(props: MetricsDataProviderProps) {
return props.entityType === "artifact" ? (
<ArtifactMetricsDataProvider {...props} />
) : props.entityType === "project" ? (
<ProjectMetricsDataProvider {...props} />
//<ProjectMetricsDataProvider {...props} />
<>{props.children}</>
) : (
assertNever(props.entityType)
);
Expand Down Expand Up @@ -387,6 +388,7 @@ function ArtifactMetricsDataProvider(props: MetricsDataProviderProps) {
);
}

/**
function ProjectMetricsDataProvider(props: MetricsDataProviderProps) {
useEnsureAuth();
const bucketWidth = getBucketWidth(props);
Expand Down Expand Up @@ -447,6 +449,7 @@ function ProjectMetricsDataProvider(props: MetricsDataProviderProps) {
/>
);
}
*/

export { MetricsDataProviderRegistration, MetricsDataProvider };
export type { MetricsDataProviderProps };
8 changes: 5 additions & 3 deletions apps/frontend/lib/graphql/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const GET_TIMESERIES_METRICS_BY_ARTIFACT = gql(`
query TimeseriesMetricsByArtifact(
$artifactIds: [String!],
$metricIds: [String!],
$startDate: Oso_DateTime!,
$endDate: Oso_DateTime!,
$startDate: Oso_Date!,
$endDate: Oso_Date!,
) {
oso_timeseriesMetricsByArtifactV0(where: {
artifactId: {_in: $artifactIds},
Expand Down Expand Up @@ -43,6 +43,7 @@ const GET_TIMESERIES_METRICS_BY_ARTIFACT = gql(`
}
`);

/**
const GET_TIMESERIES_METRICS_BY_PROJECT = gql(`
query TimeseriesMetricsByProject(
$projectIds: [String!],
Expand Down Expand Up @@ -79,8 +80,9 @@ const GET_TIMESERIES_METRICS_BY_PROJECT = gql(`
}
}
`);
*/

export {
GET_TIMESERIES_METRICS_BY_ARTIFACT,
GET_TIMESERIES_METRICS_BY_PROJECT,
//GET_TIMESERIES_METRICS_BY_PROJECT,
};
Loading

0 comments on commit a668c44

Please sign in to comment.