Skip to content

[patch] - When calculated metrics have no data available, No Data alerts are not being generated - #892

Merged
rsivaibm merged 2 commits into
masterfrom
MASMON-6799
Jun 6, 2026
Merged

rsivaibm merged 2 commits into
masterfrom
MASMON-6799

Conversation

@Radhika-Surani

Copy link
Copy Markdown
Contributor

update last_event get query

https://jsw.ibm.com/browse/MASMON-6799

Comment thread iotfunctions/bif.py Outdated
# Filter by device_id
query = query.filter(self.dms.db.get_column_object(table, entity_id_col) == device_id)

query = f"SELECT max({timestamp_col}) FROM MAIN_MAM.{table_name} WHERE DEVICEID = '{device_id}';"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Schema name should NOT be hardcoded..

Comment thread iotfunctions/bif.py Outdated
if data_item_info.get('type').upper() == 'DERIVED_METRIC':
# Get the table name from metadata
table_name = data_item_info.get('sourceTableName').upper()
query = f"SELECT max(TIMESTAMP) FROM MAIN_MAM.{table_name} WHERE KEY = '{self.input_item}' AND ENTITY_ID = '{device_id}'"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Schema name should NOT be hardcoded..

@rsivaibm rsivaibm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Schema name should NOT be hardcoded..

@rsivaibm
rsivaibm merged commit b43e310 into master Jun 6, 2026
1 check passed
@rsivaibm
rsivaibm deleted the MASMON-6799 branch June 6, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants