Skip to content

Commit 6591f06

Browse files
HarishGangulaJeraldJFravismulaRakshitha-DSurabhiAngadi
authored
RC-1.2.0 (#25)
* #OBS-I116: Dataset update API Dedupe and denorm test cases fixes * #OBS-I116: Dataset Create api test case fixes * #OBS-I116: Dataset update extraction config api test case fixes * #OBS-I116: Dataset update api test cases * #OBS-I116: fix: linting fixes * #OBS-I116: lint fixes * #OBS-I116: Dataset status transition test cases * #OBS-I116: feat: Test cases and linting fixes * #OBS-I116: feat: Dataset status transition test cases fix * #OBS-I141: added a new metric to sum the response time * #OBS-I141: modified the url variable and access dataset_id from params * #OBS-I141: added helper function to get dataset_id for error cases * #OBS-I141: added telemetry for v2 api's * #OBS-I141: added a new metric to sum the response time * #OBS-I141: modified the url variable and access dataset_id from params * #OBS-I141: added helper function to get dataset_id for error cases * #OBS-I141: added telemetry for v2 api's * #OBS-I141: added telemetry for v2 api's * #OBS-I143: feat: dataset publish changes to deploy flink connectors * #OBS-I141: removed metric for sum of response time * #OBS-I141: removed usage of builtin kafka methods from telemetry file * #OBS-I146: feat: Retire fix * Issue #SBCOSS-12 fix: convert all SQL raw queries to prepared statements * Issue #SBCOSS-12 fix: tags is an array, so requires empty json for null case; dataset draft deletion requires deletion of transformation and source config drafts * #SBCOSS-23: feat: dataset publish changes for redeployment * #OBS-I167 : read api changes while reading connectors according to v2 structure * #OBS-I173: fix: Ready to publish schema fix to expect connector configs as object and string * #OBS-I174: fix: Dataset read api fix to expect both v1 and v2 connectors * #OBS-I146: fix: Test case fix for read api * #OBS-I146: fix: Test case fix for read api changes * #OBS-I146: fix: status transition test cases * #OBS-I146: fix: Test case script fix * #OBS-I146: fix: Type error fix * #OBS-I141: removed metric for sum of response time * #OBS-I146: fix: Dataset read api test cases fixes * #OBS-I146: fix: Hudi spec generation test cases * #OBS-I146: fix: Test case and linting fix * merge commit * #OBS-I173: fix: Dataset web console required fixes * #OBS-I173: fix: Dataset update changes to accept type changes * #OBS-I167 : dataset read api changes to read live dataset source configs * #OBS-I146: fix: linting fix * #OBS-I146: fix: linting fix * #OBS-I167 : Added string or dict as type to connector_config * #OBS-I143: dataset publish changes fixes * #OBS-I167 : if dataset is empty return with error * #OBS-I143: inswert query fix * Issue #OBS-I144 fix: icon data as string; check default version * #OBS-143: fix: dataset publish fixes * #OBS-I167 : fix: removed duplicate code. * #OBS-I181 - Updated the event structure * #OBS-I164: added jwt token vwerification and access control to api's * #OBS-I164: added jwt token vwerification and access control to api's * #OBS-I164: modified the access roles and permissions * #OBS-I164: reading public key from env file * #OBS-I186 : fix: dataset metrics api * #OBS-I185 : fix: removed duplicate code. * #OBS-I164: modified public key variable in config * flink connector helm chart updates * flink connector helm chart updates * fix: dataset publish fixes * #OBS-I164: modified public key variable in config * #OBS-I186 : added dataset mertric api controller and route and minor change in dataset transition api * install pip requirments if applicable * #OBS-I186 : removed export statement * #OBS-I164: added config for option rbac verification * #OBS-I164: changed the middleware to rbac_middleware * #OBS-I186 : Logic moved to separate function * #OBS-I164: changed import name * #OBS-I186 : Logic moved to separate function * #OBS-I185 : fix: test case fixes * #OBS-I185 : fix: linting fix * #OBS-I164: modified config and rbac middleware * #OBS-I164: added jsonwebtoken package * V2 apis (#240) * #OBS-I115: Dataset list API refactoring * #0000: adding command api * #OBS-I116: Dataset CRUD APIs test and fixes * #OBS-I115: cmd api remove addn modules * #OBS-I116: Dataset status trasition to retire check for denorm fields * #OBS-I116: Dataset CRUD APIs test cases and fixes * #OBS-I115: Dataset Transition API refactoring * #OBS-I115: Dataset Transition API refactoring * #OBS-I116: Dataset update API Dedupe and denorm test cases fixes * #OBS-I115: Dataset Transition API refactoring and error handling refactoring * #OBS-I115: Dataset Transition API refactoring * #OBS-I115: Dataset Transition API refactoring * #OBS-I115: Remove unnecessary field fields_set * #OBS-I115: Dataset publish API - update the index of hudi spec properly for publish to handle schema evolution * #OBS-I116: Dataset create and status transition api code fix * #OBS-I116: Dataset Create api test case fixes * #OBS-I116: Dataset update extraction config api test case fixes * #OBS-I116: Dataset druid ingestion spec generation fix * #OBS-I116: express version upgraded * #OBS-I116: Dataset create api fixes * #OBS-I116: Dataset ingestion spec generation fix * #OBS-I126: updated swagger documentation * #OBS-I126: updated postman collection * #OBS-I126: updated postman collection * #OBS-I116: fix: entry topic column in datasets model * #OBS-I58 feat: Minio cloud store support - Added endpoint. as optional config to support the minio * #OBS-I126: added dataset read, list, update api's documentation and updated collection * #OBS-I116: feat: Dataschema api implementation v2 * #OBS-I116: feat: Schema validation fix * #OBS-I126: swagger doc updated * #OBS-I116: Dataset update api test cases * #OBS-I116: fix: linting fixes * #OBS-I116: lint fixes * #OBS-I116: Dataset status transition test cases * #OBS-I126 : added multiple requests example * #OBS-I126 : updated order * #OBS-I126 : updated server url * #OBS-I21: feat: dataset publish changes for connectors * #OBS-I1 updated Dataset Health API code * #OBS-I116: Dataset CRUD api fixes * #OBS-I116: fix: error codes fix * #OBS-I1 Refactored as per new changes * #OBS-I101: Update the publish API for the v2 APIs * #OBS-I101: fix db models * #OBS-I115: Remove the v1 unused API code and restructure the folders * #OBS-I1 Added DatasethealthService * #OBS-I1 Updated the imports and folders * #OBS-I2 updated dataset reset * #OBS-I116: fix: Command api and schema fixes * #OBS-I116: fix: Command api fix in db query * #OBS-I1 Added Notifications and alerts APIs * #OBS-I138: added decrypted response for the read api for connectors_config field and added defaults updated date and created date to list api * #OBS-I116: fix: feat: Dataset copy and export api implementation * #OBS-I2 Refactoring as per v2 APIs * #OBS-I2 typo fix * #OBS-I116: fix: fix: Dataset copy check for dataset fix * #OBS-I21: dataset publish changes fixes * #OBS-I116: fix: feat: Feedback fixes of removing set redis db * #OBS-I138: added cors to app * #OBS-I116: fix: feat: Dataset import api implementation * #OBS-I116: fix: fix: Dataset service fix * #OBS-I116: fix: repeated Validation method removal * #OBS-I116: fix: unused code * connector list * #OBS-I142: connector list api * #OBS-I116: fix: schema validation check for v1 exported dataset. * #OBS-I116: fix: Dataset overwrite after creation failure * #OBS-I116: fix: error handling * #OBS-I116: fix: error messages fix * #OBS-I116: fix: code fixes * #OBS-I142: formatted connector list api files * #OBS-I142: formatted connector list api files * #OBS-I142: formatted connector list file * #OBS-I138: required changes for dataset for master dataset migration from v1 to v2 * #OBS-I138: removed cors package * #OBS-I138: updated package json file * #OBS-I138: indentation fix * #OBS-I138: indentation fix * #OBS-I138: fixed indentations * #OBS-I142: updated postman collection * #OBS-I142: added connector list swagger documentation * #OBS-I142: updated postman collection * #OBS-I116: feat: Dataset Import and export api integration fixes * #OBS-I138: removed comment * #OBS-I138: throwing error if dataset is undefined * #OBS-I142: added test cases for connector list * #OBS-I138: merging dataset defaults to dataset draft record before saving * #OBS-I138: adding merged event to dataset while migrating live or draft dataset * #OBS-I142: added live_date field to defaultFields * #OBS-I145: Connector Read API * #OBS-I145: updated postman collection with connector read api * #OBS-I145: updated swagger documentation * #OBS-I145: updated the connector read api * merge changes * merge changes * Resolved merge changes * Resolved merge changes * #OBS-I145: updated the connector read api * #OBS-I138: removed datakey before merging defaults to dataset * #OBS-I145: updated postman collection and swagger documentation * #OBS-I145: added the test cases for connector read api * #OBS-I145: added a test case for connector read api * #OBS-I116: feat: Dataset import api fixes * #OBS-I116: feat: Test cases and linting fixes * #OBS-I116: feat: Dataset status transition test cases fix * #OBS-I1 updated the routes * #OBS-I116: feat: Dataset migratio method fix * #OBS-I108: feat: helm modifications for flink connectors * #OBS-I108: helm chart fixes * #OBS-I108: feat: Modify volume mounts * #OBS-I108: feat: Add PVC for JobManager * #OBS-I108: feat: change args for jobmanager command * #OBS-I141: added a new metric to sum the response time * #OBS-I141: modified the url variable and access dataset_id from params * #OBS-I141: added helper function to get dataset_id for error cases * #OBS-I108: feat: Use sidecar container to submit connector flink job * #OBS-I141: added telemetry for v2 api's * #OBS-I141: added a new metric to sum the response time * #OBS-I141: modified the url variable and access dataset_id from params * #OBS-I141: added helper function to get dataset_id for error cases * #OBS-I141: added telemetry for v2 api's * #OBS-I141: added telemetry for v2 api's * #OBS-I143: feat: dataset publish changes to deploy flink connectors * #OBS-I141: removed metric for sum of response time * #OBS-I141: removed usage of builtin kafka methods from telemetry file * #OBS-I146: feat: Retire fix * Issue #SBCOSS-12 fix: convert all SQL raw queries to prepared statements * Issue #SBCOSS-12 fix: tags is an array, so requires empty json for null case; dataset draft deletion requires deletion of transformation and source config drafts * #SBCOSS-23: feat: dataset publish changes for redeployment * #OBS-I167 : read api changes while reading connectors according to v2 structure * #OBS-I173: fix: Ready to publish schema fix to expect connector configs as object and string * #OBS-I174: fix: Dataset read api fix to expect both v1 and v2 connectors * #OBS-I146: fix: Test case fix for read api * #OBS-I146: fix: Test case fix for read api changes * #OBS-I146: fix: status transition test cases * #OBS-I146: fix: Test case script fix * #OBS-I146: fix: Type error fix * #OBS-I141: removed metric for sum of response time * #OBS-I146: fix: Dataset read api test cases fixes * #OBS-I146: fix: Hudi spec generation test cases * #OBS-I146: fix: Test case and linting fix * merge commit * #OBS-I173: fix: Dataset web console required fixes * #OBS-I173: fix: Dataset update changes to accept type changes * #OBS-I167 : dataset read api changes to read live dataset source configs * #OBS-I146: fix: linting fix * #OBS-I146: fix: linting fix * #OBS-I167 : Added string or dict as type to connector_config * #OBS-I143: dataset publish changes fixes * #OBS-I167 : if dataset is empty return with error * #OBS-I143: inswert query fix * Issue #OBS-I144 fix: icon data as string; check default version * #OBS-143: fix: dataset publish fixes * #OBS-I167 : fix: removed duplicate code. * #OBS-I181 - Updated the event structure * #OBS-I164: added jwt token vwerification and access control to api's * #OBS-I164: added jwt token vwerification and access control to api's * #OBS-I164: modified the access roles and permissions * #OBS-I164: reading public key from env file * #OBS-I186 : fix: dataset metrics api * #OBS-I185 : fix: removed duplicate code. * #OBS-I164: modified public key variable in config * flink connector helm chart updates * flink connector helm chart updates * fix: dataset publish fixes * #OBS-I164: modified public key variable in config * #OBS-I186 : added dataset mertric api controller and route and minor change in dataset transition api * install pip requirments if applicable * #OBS-I186 : removed export statement * #OBS-I164: added config for option rbac verification * #OBS-I164: changed the middleware to rbac_middleware * #OBS-I186 : Logic moved to separate function * #OBS-I164: changed import name * #OBS-I186 : Logic moved to separate function * #OBS-I185 : fix: test case fixes * #OBS-I185 : fix: linting fix * #OBS-I164: modified config and rbac middleware * #OBS-I164: added jsonwebtoken package * master url fix --------- Co-authored-by: Santhosh Vasabhaktula <santhosh@sanketika.in> Co-authored-by: JeraldJF <jeraldj@sanketika.in> Co-authored-by: yashashk <yashashk@sanketika.in> Co-authored-by: harishkumar gangula <harish@sanketika.in> Co-authored-by: SurabhiAngadi <surabhia@sanketika.in> Co-authored-by: Rakshitha-D <rakshithagowda.d@gmail.com> Co-authored-by: Anand Parthasarathy <anandp504@gmail.com> Co-authored-by: Aniket Sakinala <aniket@sanketika.in> * Resolved test case issue * Merge conflicts changes * #OBS-I165: added userInfo from token to request object * #OBS-I165: updated telemetry to use user role * #OBS-I165: updated datasetCreate api to add userRole as created_by * #OBS-I165: added userRole when migrating and create table from live * #OBS-I165: added userRole for data copy api * #OBS-I165: added userRole for dataset Update * #OBS-I165: added userRole for dataset Import * #OBS-I165: added userRole for dataset status transition * #OBS-I165: modified Dataset Service to update the userRoles * #OBS-I165: added permission for queryTemplateUpdate api * #OBS-I165: added userRole for query template create and update * #OBS-I165: added userRole for alerts api * #OBS-I165: added userRole for notifications api * #OBS-I165: added userRole for silences api * #OBS-I86 : commented routes have regex * #OBS-I77 : query api changes to check datasource avialability v2 * #OBS-I77 : fix: test cases * #OBS-I165: corrections userRole access in notification * #OBS-I165: added operations_admin role and updated permissions * #OBS-I165: added rbac middleware for alert routers * #OBS-I165: modified the user permissions into a json object * #OBS-I165: removed unused code * #OBS-I203: Remove the archived and purged status transition from the API * #OBS-I165: added user permissions json * #OBS-I165: removed user roles for type * #OBS-I165: added userID to req object and importing permissions from jsonfile * #OBS-I165: handled rbac disabled scenario and updated userID instead of userRole * #OBS-I165: changed the userRole to userID * #OBS-I165: added createdby for dataset publish api * #OBS-I165: added error condition and modified status code * #OBS-I165: removed redundant code * #OBS-I222 : Resolved regexp route issue in express version 5 * #OBS-I77 : query api changes to check avialability of datasource * #OBS-I77 : fix: spell fix * #OBS-I77 : granularity spell changes * #OBS-I77 : fix: test scenarios added * #OBS-I131 : fix: stop deleting draft records if submission tasks fail * #OBS-I131 : fix: upsert if republished * #OBS-I131 : fix: test case fixes * #OBS-I165: added default userID, modified error codes, added errorhandler function * #OBS-I165: added updatedby by default when an entry created * #OBS-I165: removed redundant code * #OBS-I165: modified errorhandler * #OBS-I165: modified error message * #OBS-I227 : fix: threshold of dataset level alerts inside an array. * #OBS-I179 : feat: retire dataset related alerts and metrics on dataset retire * #OBS-I79: feat: test case fixes * #OBS-I79: feat: Alerts get fix * feat: command tag name change (#252) * feat: command tag name change (#252) (#254) * #0000 fix: ingestion spec cache fix * Ingestion spec fix (#255) * feat: command tag name change (#252) (#254) * #0000 fix: ingestion spec cache fix --------- Co-authored-by: Ravi Mula <ravismula@users.noreply.github.com> * #OBS-I230: fix: kafka command * #OBS-I230: fix: cache issues changes * #OBS-I230: fix: redis db number change on update * #OBS-I187: added model for user * #OBS-I187: added userService * #OBS-I187: modified to verify keycloak token * #OBS-I187: updated rbac middleware * #OBS-I187: add seperate function to check access * #OBS-I230: fix: integration fixes * #OBS-I230: fix: kafka command fixes (#258) * #OBS-I230: fix: kafka command fixes * #OBS-I247: fix: feedback changes. --------- Co-authored-by: Ravi Mula <ravismula@users.noreply.github.com> * #OBS-I218 update kafka connector image tags * #OBS-I288: fix: removed data_format field from connector_instance (#260) * #OBS-I285: query api fix to validate and set limit to sql queries * #I285: removed empty objects and arrays from sample data (#261) * #I285: removed empty objects and arrays from sample data * Fix code scanning alert no. 98: Loop bound injection Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * #I285: lint issues fixed --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * #OBS-I285: query api to parse sql query first then do regex check with postman * #OBS-I285: fix: linting issue fix * #OBS-I285: fix: lint fix * #OBS-I285: fix: Logging errors in the middleware (#263) * #OBS-I285: fix: Logging errors in the middleware * #OBS-I285: fix: Logging errors by excluding sensitive info * #OBS-I285: fix: linting issue fix * #OBS-I289 : added route (#265) * fix: Stop the connectors specific to the dataset. (#266) * fix: uninstall dataset specific spark jobs * fix: remove nested loops * fix: uninstall dataset specific spark jobs * fix: remove nested loops * #OBS-I289 fix: Fix flink connector deployments * #OBS-I289 fix: Fix Spark Connector deployments * #OBS-I307 - revert the code as this is fixed from the front end (#268) * #OBS-I330 : changed type from hudi to datalake * fix for object-store-connector cron (#269) * #OBS-I330 : fixed merging issue * #OBS-I330 : removed comment * #OBS-I330 : Using dataset v2 export api while publishing * #OBS-I330 : removed print statement * #OBS-I330 : Using dataset v2 export api while publishing (#271) * #OBS-I330 : Using dataset v2 export api while publishing * #OBS-I330 : removed print statement * #OBS-I330 : Replacing - with _ for datasource_ref and adding partition key and primary key and timestamp key in column spec of ingestion spec * Hudi fixes (#272) * #OBS-I330 : Using dataset v2 export api while publishing * #OBS-I330 : removed print statement * #OBS-I330 : Replacing - with _ for datasource_ref and adding partition key and primary key and timestamp key in column spec of ingestion spec * fix: update connector instance id when inserting to db * #OBS-I330 : removed merging defaults to keys_config * #OBS-I330 : omit merging defaults to draft dataset for keys_config * #OBS-I335: hudi spec fix * #OBS-I335: hudi spec fix * #OBS-I335: linting fix * #OBS-I334 - clear transformations on re-upload * #OBS-I334 - clear keys_config on re-upload of schema file * #OBS-I335: dataset update fix * #OBS-I335: loop bound issue fix * #OBS-I335: dataset updated as per feedbacks * append base64 prefix upon connector register * #OBS-I334 - Fix the schema update functionality * Data mapping fix (#278) * #OBS-I335: hudi spec fix (#279) --------- Co-authored-by: JeraldJF <jeraldj@sanketika.in> Co-authored-by: Ravi Mula <ravismula@users.noreply.github.com> Co-authored-by: Rakshitha-D <rakshithagowda.d@gmail.com> Co-authored-by: SurabhiAngadi <surabhia@sanketika.in> Co-authored-by: Aniket Sakinala <aniket@sanketika.in> Co-authored-by: yashashk <yashashk@sanketika.in> Co-authored-by: Santhosh Vasabhaktula <santhosh@sanketika.in> Co-authored-by: Anand Parthasarathy <anandp504@gmail.com> Co-authored-by: Jerald <127138957+JeraldJF@users.noreply.github.com> Co-authored-by: Rakshitha-D <115482806+Rakshitha-D@users.noreply.github.com> Co-authored-by: SurabhiAngadi <138881390+SurabhiAngadi@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: yashash <126703764+yashashkumar@users.noreply.github.com>
1 parent b9174ea commit 6591f06

File tree

79 files changed

+5042
-3092
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+5042
-3092
lines changed

.github/workflows/build_and_deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
context: ./command-service
4444
platforms: linux/amd64
4545
push: true
46-
tags: ${{ vars.DOCKERHUB_USERNAME }}/flink-command-service:${{ github.ref_name }}
46+
tags: ${{ vars.DOCKERHUB_USERNAME }}/obsrv-command-service:${{ github.ref_name }}
4747

4848
aws-deploy:
4949
needs: [build-api-service-image, build-command-service-image]

api-service/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@
2828
"aws-sdk": "^2.1348.0",
2929
"axios": "^1.6.0",
3030
"body-parser": "^1.20.2",
31+
"busboy": "^1.6.0",
3132
"compression": "^1.7.4",
3233
"dateformat": "2.0.0",
3334
"express": "^5.0.0-beta.3",
3435
"http-errors": "^2.0.0",
3536
"http-status": "^1.5.3",
37+
"jsonwebtoken": "^9.0.1",
3638
"kafka-node": "^5.0.0",
3739
"kafkajs": "^2.2.4",
3840
"kafkajs-snappy": "^1.1.0",
@@ -59,12 +61,14 @@
5961
"@babel/traverse": "7.23.2"
6062
},
6163
"devDependencies": {
64+
"@types/busboy": "^1.5.4",
6265
"@types/chai": "^4.3.3",
6366
"@types/chai-as-promised": "^7.1.5",
6467
"@types/chai-spies": "^1.0.3",
6568
"@types/compression": "^1.7.2",
6669
"@types/express": "^4.17.14",
6770
"@types/http-errors": "^2.0.1",
71+
"@types/jsonwebtoken": "^9.0.6",
6872
"@types/kafkajs": "^1.9.0",
6973
"@types/knex": "^0.16.1",
7074
"@types/lodash": "^4.14.190",

api-service/postman-collection/Obsrv API Service.postman_collection_v2.json

Lines changed: 0 additions & 1882 deletions
This file was deleted.

api-service/postman-collection/updated_v2_collection.json renamed to api-service/postman-collection/Obsrv v2 apis.postman_collection.json

Lines changed: 3113 additions & 514 deletions
Large diffs are not rendered by default.

api-service/src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ app.use("/v2/", v2Router);
2222
app.use("/", druidProxyRouter);
2323
app.use("/alerts/v1", alertsRouter);
2424
app.use("/", metricRouter);
25-
app.use("*", ResponseHandler.routeNotFound);
25+
app.use(/(.*)/, ResponseHandler.routeNotFound);
2626
app.use(obsrvErrorHandler);
2727

2828
app.listen(config.api_port, () => {

api-service/src/configs/Config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,7 @@ export const config = {
112112
"dialect": process.env.dialet || "postgres",
113113
"url": process.env.grafana_url || "http://localhost:8000",
114114
"access_token": process.env.grafana_token || ""
115-
}
115+
},
116+
"user_token_public_key": process.env.user_token_public_key || "",
117+
"is_RBAC_enabled": process.env.is_rbac_enabled || "false",
116118
}

api-service/src/configs/IngestionConfig.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ export const rawIngestionSpecDefaults = {
5454
"type": "text",
5555
"expr": "$.obsrv_meta.syncts"
5656
},
57+
"hudiSynctsField": {
58+
"name": "obsrv_meta_syncts",
59+
"arrival_format": "text",
60+
"data_type": "date",
61+
"type": "text",
62+
"expr": "$.obsrv_meta.syncts"
63+
},
5764
"dimensions": [
5865
{
5966
"type": "string",
@@ -64,6 +71,16 @@ export const rawIngestionSpecDefaults = {
6471
"name": "obsrv.meta.source.id"
6572
}
6673
],
74+
"hudi_dimensions": [
75+
{
76+
"type": "string",
77+
"name": "obsrv_meta_source_connector"
78+
},
79+
{
80+
"type": "string",
81+
"name": "obsrv_meta_source_id"
82+
}
83+
],
6784
"flattenSpec": [
6885
{
6986
"type": "path",
@@ -75,5 +92,17 @@ export const rawIngestionSpecDefaults = {
7592
"expr": "$.obsrv_meta.source.connectorInstance",
7693
"name": "obsrv.meta.source.id"
7794
}
95+
],
96+
"hudi_flattenSpec": [
97+
{
98+
"type": "path",
99+
"expr": "$.obsrv_meta.source.connector",
100+
"name": "obsrv_meta_source_connector"
101+
},
102+
{
103+
"type": "path",
104+
"expr": "$.obsrv_meta.source.connectorInstance",
105+
"name": "obsrv_meta_source_id"
106+
}
78107
]
79108
}

api-service/src/connections/commandServiceConnection.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ export const executeCommand = async (id: string, command: string) => {
1818
}
1919
}
2020
return commandHttpService.post(commandPath, payload)
21+
}
22+
23+
export const registerConnector = async (requestBody: any) => {
24+
return commandHttpService.post("/connector/v1/register", requestBody)
2125
}

api-service/src/controllers/Alerts/Alerts.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ const telemetryObject = { type: "alert", ver: "1.0.0" };
1313
const createAlertHandler = async (req: Request, res: Response, next: NextFunction) => {
1414
try {
1515
const alertPayload = getAlertPayload(req.body);
16+
const userID = (req as any)?.userID;
17+
_.set(alertPayload, "created_by", userID);
18+
_.set(alertPayload, "updated_by", userID);
1619
const response = await Alert.create(alertPayload);
1720
updateTelemetryAuditEvent({ request: req, object: { id: response?.dataValues?.id, ...telemetryObject } });
1821
ResponseHandler.successResponse(req, res, { status: httpStatus.OK, data: { id: response.dataValues.id } });
@@ -28,8 +31,11 @@ const createAlertHandler = async (req: Request, res: Response, next: NextFunctio
2831
const publishAlertHandler = async (req: Request, res: Response, next: NextFunction) => {
2932
try {
3033
const { alertId } = req.params;
31-
const rulePayload: Record<string, any> | null = await getAlertRule(alertId);
32-
if (!rulePayload) return next({ message: httpStatus[httpStatus.NOT_FOUND], statusCode: httpStatus.NOT_FOUND });
34+
const ruleModel: Record<string, any> | null = await getAlertRule(alertId);
35+
if (!ruleModel) return next({ message: httpStatus[httpStatus.NOT_FOUND], statusCode: httpStatus.NOT_FOUND });
36+
const rulePayload = ruleModel.toJSON();
37+
const userID = (req as any)?.userID;
38+
_.set(rulePayload, "updated_by", userID);
3339
if (rulePayload.status == "live") {
3440
await deleteAlertRule(rulePayload, false);
3541
}
@@ -87,6 +93,8 @@ const deleteAlertHandler = async (req: Request, res: Response, next: NextFunctio
8793
return next({ message: httpStatus[httpStatus.NOT_FOUND], statusCode: httpStatus.NOT_FOUND });
8894
}
8995
const rulePayload = ruleModel.toJSON();
96+
const userID = (req as any)?.userID || "SYSTEM";
97+
_.set(rulePayload, "updated_by", userID);
9098
await deleteAlertRule(rulePayload, hardDelete === "true");
9199
updateTelemetryAuditEvent({ request: req, currentRecord: rulePayload, object: { id: alertId, ...telemetryObject } });
92100
ResponseHandler.successResponse(req, res, { status: httpStatus.OK, data: { id: alertId } });
@@ -103,12 +111,14 @@ const updateAlertHandler = async (req: Request, res: Response, next: NextFunctio
103111
const ruleModel = await getAlertRule(alertId);
104112
if (!ruleModel) { return next({ message: httpStatus[httpStatus.NOT_FOUND], statusCode: httpStatus.NOT_FOUND }) }
105113
const rulePayload = ruleModel.toJSON();
114+
const userID = (req as any)?.userID;
106115
if (rulePayload.status == "live") {
116+
_.set(rulePayload, "updated_by", userID);
107117
await deleteAlertRule(rulePayload, false);
108118
await retireAlertSilence(alertId);
109119
}
110120
const updatedPayload = getAlertPayload({ ...req.body, manager: rulePayload?.manager });
111-
await Alert.update({ ...updatedPayload, status: "draft" }, { where: { id: alertId } });
121+
await Alert.update({ ...updatedPayload, status: "draft", updated_by: userID }, { where: { id: alertId } });
112122
updateTelemetryAuditEvent({ request: req, currentRecord: rulePayload, object: { id: alertId, ...telemetryObject } });
113123
ResponseHandler.successResponse(req, res, { status: httpStatus.OK, data: { id: alertId } });
114124
} catch (error: any) {

api-service/src/controllers/Alerts/Silence.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ const createHandler = async (request: Request, response: Response, next: NextFun
2020

2121
const start_date = new Date(startDate);
2222
const end_date = new Date(endDate);
23+
const userID = (request as any)?.userID;
2324
const silenceBody = {
2425
id: grafanaResponse.silenceId,
2526
manager: grafanaResponse.manager,
2627
alert_id: alertId,
2728
start_time: start_date,
2829
end_time: end_date,
30+
created_by : userID,
31+
updated_by : userID,
2932
}
3033
const sileneResponse = await Silence.create(silenceBody);
3134
updateTelemetryAuditEvent({ request, object: { id: sileneResponse?.dataValues?.id, ...telemetryObject } });
@@ -78,10 +81,12 @@ const updateHandler = async (request: Request, response: Response, next: NextFun
7881
await updateSilence(silenceObject, payload);
7982
const updatedStartTime = new Date(payload.startTime);
8083
const updatedEndTime = new Date(payload.endTime);
84+
const userID = (request as any)?.userID;
8185
const updatedSilence = {
8286
...silenceObject,
8387
start_time: updatedStartTime,
84-
end_time: updatedEndTime
88+
end_time: updatedEndTime,
89+
updated_by: userID,
8590
}
8691
const silenceResponse = await Silence.update(updatedSilence, { where: { id } })
8792
ResponseHandler.successResponse(request, response, { status: httpStatus.OK, data: { silenceResponse } })

0 commit comments

Comments
 (0)