Skip to content

Commit

Permalink
Merge pull request #38 from weni-ai/feature/sentry
Browse files Browse the repository at this point in the history
Add: sentry
  • Loading branch information
zMardone authored Jun 13, 2024
2 parents c9e1d65 + 76842f5 commit 54df6bb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ def __init__(self):
"INDEX_CONTENTBASES_NAME", "content_bases"
)
self.sentry_dsn = os.environ.get("SENTRY_DSN", "")
self.environment = os.environ.get("ENVIRONMENT", "local")
self.es_timeout = os.environ.get("ELASTICSEARCH_TIMEOUT", "30")
3 changes: 3 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from langchain.embeddings import HuggingFaceHubEmbeddings, CohereEmbeddings
from langchain.embeddings.base import Embeddings
from langchain.vectorstores import ElasticVectorSearch, VectorStore, ElasticsearchStore
from sentry_sdk.integrations.fastapi import FastApiIntegration

from app.handlers import IDocumentHandler
from app.handlers.products import ProductsHandler
Expand Down Expand Up @@ -58,6 +59,8 @@ def __init__(self, config: AppConfig):
if config.sentry_dsn != "":
sentry_sdk.init(
dsn=config.sentry_dsn,
integrations=[FastApiIntegration()],
environment=config.environment,
)

self.api = FastAPI()
Expand Down
22 changes: 12 additions & 10 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ python-dotenv = "^1.0.0"
pydantic = "2.3.0"
celery = "^5.3.6"
redis = "^5.0.1"
sentry-sdk = {extras = ["fastapi"], version = "^1.35.0"}
sentry-sdk = {extras = ["fastapi"], version = "^2.5.1"}
xlrd = "^2.0.1"
pdfminer-six = "^20231228"
cohere = "^4.37"
Expand Down

0 comments on commit 54df6bb

Please sign in to comment.