Skip to content

Commit

Permalink
feat(api): add version on startup logs (#2390)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl authored Nov 4, 2024
1 parent c791b85 commit 520c842
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions keep/api/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import asyncio
import logging
import os
from importlib import metadata

import requests
Expand All @@ -27,6 +27,7 @@
)
from keep.api.core.dependencies import SINGLE_TENANT_UUID
from keep.api.logging import CONFIG as logging_config
from keep.api.middlewares import LoggingMiddleware
from keep.api.routes import (
actions,
ai,
Expand Down Expand Up @@ -65,8 +66,6 @@
from keep.workflowmanager.workflowmanager import WorkflowManager
from keep.workflowmanager.workflowstore import WorkflowStore

from keep.api.middlewares import LoggingMiddleware

load_dotenv(find_dotenv())
keep.api.logging.setup_logging()
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -99,8 +98,19 @@ def get_app(
auth_type: IdentityManagerTypes = IdentityManagerTypes.NOAUTH.value,
) -> FastAPI:
if not os.environ.get("KEEP_API_URL", None):
logger.info(
"KEEP_API_URL is not set, setting it to default",
extra={"keep_api_url": f"http://{HOST}:{PORT}"},
)
os.environ["KEEP_API_URL"] = f"http://{HOST}:{PORT}"
logger.info(f"Starting Keep with {os.environ['KEEP_API_URL']} as URL")

logger.info(
f"Starting Keep with {os.environ['KEEP_API_URL']} as URL and version {KEEP_VERSION}",
extra={
"keep_version": KEEP_VERSION,
"keep_api_url": os.environ.get("KEEP_API_URL"),
},
)

app = FastAPI(
title="Keep API",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "keep"
version = "0.28.0"
version = "0.28.1"
description = "Alerting. for developers, by developers."
authors = ["Keep Alerting LTD"]
readme = "README.md"
Expand Down

0 comments on commit 520c842

Please sign in to comment.