Skip to content

Commit

Permalink
Update requirements.txt to use latest opni-proto library
Browse files Browse the repository at this point in the history
  • Loading branch information
AmartC committed Nov 23, 2022
1 parent f2ec3ba commit 42c38dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@ async def receive_template_data(queue):
es = await setup_es_connection()
while True:
df = await queue.get()
await update_template_data(es, df, queue)
await update_template_data(es, df)


async def receive_logs(queue):
es = await setup_es_connection()
while True:
df = await queue.get()
await update_logs(es, df, queue)
await update_logs(es, df)

async def update_template_data(es, df, queue):
async def update_template_data(es, df):
try:
async for ok, result in async_streaming_bulk(
es,
Expand All @@ -119,9 +119,8 @@ async def update_template_data(es, df, queue):
"Failed to index data. Re-adding to queue"
)
logging.error(exception)
await queue.put(df)

async def update_logs(es, df, queue):
async def update_logs(es, df):
# This function will be updating Opensearch logs which were inferred on by the DRAIN model.
model_keywords_dict = {"drain": ["_id", "masked_log", "template_matched","template_cluster_id","inference_model", "anomaly_level"],
"opnilog": ["_id", "masked_log", "anomaly_level", "template_matched","template_cluster_id","opnilog_confidence", "inference_model"]}
Expand Down Expand Up @@ -151,7 +150,6 @@ async def update_logs(es, df, queue):
"Failed to index data. Re-adding to queue"
)
logging.error(exception)
await queue.put(anomaly_level_df[model_keywords_dict[model_name]])


async def init_nats():
Expand Down
2 changes: 1 addition & 1 deletion aiops/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
elasticsearch[async]==7.13.0
numpy==1.22.0
opni-nats==0.0.0.4
dev-proto==0.6.0.0
opni-proto==0.6.1.0
pandas==1.2.3

0 comments on commit 42c38dd

Please sign in to comment.