Skip to content

Commit

Permalink
Merge branch 'main' into table-metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
yashashkumar authored Jan 15, 2025
2 parents 4391985 + edff55d commit ee1cd5c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions api-service/src/configs/IngestionConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ export const rawIngestionSpecDefaults = {
"flattenSpec": [
{
"type": "path",
"expr": "$.obsrv_meta.source.connector",
"expr": "$.obsrv_meta.source.entry_source",
"name": "obsrv.meta.source.connector"
},
{
"type": "path",
"expr": "$.obsrv_meta.source.connectorInstance",
"expr": "$.obsrv_meta.source.id",
"name": "obsrv.meta.source.id"
}
],
Expand Down
8 changes: 6 additions & 2 deletions api-service/src/middlewares/userPermissions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"api.datasets.list",
"api.datasets.read",
"api.datasets.export",
"api.dataset.health",
"api.data.out",
"api.data.exhaust",
"api.alert.list",
Expand Down Expand Up @@ -47,7 +48,6 @@
"api.datasets.update",
"api.datasets.import",
"api.datasets.copy",
"api.dataset.health",
"api.datasets.dataschema"
],
"data": [
Expand Down Expand Up @@ -117,7 +117,11 @@
"file",
"connector",
"sqlQuery",
"restricted_dataset_api"
"restricted_dataset_api",
"alert",
"metric",
"silence",
"notificationChannel"
],
"operations_admin": [
"alert",
Expand Down
2 changes: 1 addition & 1 deletion api-service/src/services/TableGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class BaseTableGenerator {
}
if (!_.isEmpty(transformations_config)) {
const transformationFields = _.map(transformations_config, (tf) => ({
expr: "$." + `['${tf.field_key}']`,
expr: "$." + tf.field_key.split('.').map((fieldpart: string) => `['${fieldpart}']`).join('.'),
name: tf.field_key,
data_type: tf.transformation_function.datatype,
arrival_format: tf.transformation_function.datatype,
Expand Down
13 changes: 7 additions & 6 deletions command-service/src/command/alert_manager_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from model.data_models import Action, ActionResponse, CommandPayload
from service.db_service import DatabaseService
from service.http_service import HttpService

from copy import deepcopy

class AlertManagerService(ICommand):

Expand Down Expand Up @@ -95,17 +95,18 @@ def get_dataset_source_config(self, dataset_id: str) -> str:
def get_modified_metric(
self, service: str, metric: dict, payload: CommandPayload
) -> dict:
metric_data = deepcopy(metric)
if service == "flink":
substring = f"{payload.dataset_id}"
modified_substring = substring.replace("-", "_")
modified_metric = metric["metric"].replace("dataset_id", modified_substring)
metric["metric"] = modified_metric
return metric
modified_metric = metric_data["metric"].replace("dataset_id", modified_substring)
metric_data["metric"] = modified_metric
return metric_data
else:
metric["metric"] = metric["metric"].replace(
metric_data["metric"] = metric_data["metric"].replace(
"dataset_id", payload.dataset_id
)
return metric
return metric_data

def create_alert_metric(
self, payload: CommandPayload, service: str, metric: dict, dataset_name: str
Expand Down

0 comments on commit ee1cd5c

Please sign in to comment.