From 20f3c20186cc102910942adfe5152e598a4e7e9e Mon Sep 17 00:00:00 2001 From: GitInno <86991526+gitnnolabs@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:58:00 -0300 Subject: [PATCH 1/2] Adiciona as dependencias do ES --- requirements/base.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/requirements/base.txt b/requirements/base.txt index ae6291db..b611190b 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -85,3 +85,9 @@ langcodes==3.3.0 # https://pypi.org/project/langcodes/ # PyAlex # ------------------------------------------------------------------------------ pyalex==0.14 # https://github.com/J535D165/pyalex + +# Elastic +# ------------------------------------------------------------------------------ +elastic-transport==8.15.1 +elasticsearch==7.17.12 +pyelasticsearch==1.4.1 From 6a93c5646a5b7cb94b75de2b2e6bbf9fe15476d7 Mon Sep 17 00:00:00 2001 From: GitInno <86991526+gitnnolabs@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:58:36 -0300 Subject: [PATCH 2/2] Remove o APM. --- config/settings/production.py | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/config/settings/production.py b/config/settings/production.py index 50e81415..9d8d26f4 100644 --- a/config/settings/production.py +++ b/config/settings/production.py @@ -186,21 +186,21 @@ # Elastic-APM # https://www.elastic.co/guide/en/apm/agent/python/current/django-support.html # ------------------------------------------------------------------------------ -ELASTIC_APM_DISABLE_SEND = env.bool("ELASTIC_APM_DISABLE_SEND", default=True) - -INSTALLED_APPS += ["elasticapm.contrib.django"] - -ELASTIC_APM = { - # Set the required service name. Allowed characters: - # a-z, A-Z, 0-9, -, _, and space - "SERVICE_NAME": env("ELASTIC_APM_SERVICE_NAME", default="OCABR-SciELO"), - # Use if APM Server requires a secret token - "SECRET_TOKEN": env("ELASTIC_APM_SECRET_TOKEN", default=""), - # Set the custom APM Server URL (default: http://localhost:8200) - "SERVER_URL": env("ELASTIC_APM_SERVER_URL", default="http://siem.scielo.org:8200"), - # Set the service environment - "ENVIRONMENT": env("ELASTIC_APM_ENVIRONMENT", default="produciton"), -} - -MIDDLEWARE.insert(0, "elasticapm.contrib.django.middleware.TracingMiddleware") -MIDDLEWARE.insert(1, "elasticapm.contrib.django.middleware.Catch404Middleware") +# ELASTIC_APM_DISABLE_SEND = env.bool("ELASTIC_APM_DISABLE_SEND", default=True) + +# INSTALLED_APPS += ["elasticapm.contrib.django"] + +# ELASTIC_APM = { +# # Set the required service name. Allowed characters: +# # a-z, A-Z, 0-9, -, _, and space +# "SERVICE_NAME": env("ELASTIC_APM_SERVICE_NAME", default="OCABR-SciELO"), +# # Use if APM Server requires a secret token +# "SECRET_TOKEN": env("ELASTIC_APM_SECRET_TOKEN", default=""), +# # Set the custom APM Server URL (default: http://localhost:8200) +# "SERVER_URL": env("ELASTIC_APM_SERVER_URL", default="http://siem.scielo.org:8200"), +# # Set the service environment +# "ENVIRONMENT": env("ELASTIC_APM_ENVIRONMENT", default="produciton"), +# } + +# MIDDLEWARE.insert(0, "elasticapm.contrib.django.middleware.TracingMiddleware") +# MIDDLEWARE.insert(1, "elasticapm.contrib.django.middleware.Catch404Middleware")