Skip to content
Snippets Groups Projects
Commit 3c271812 authored by Agustin Dorda's avatar Agustin Dorda
Browse files

APM y logger

parent 3abff66b
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,18 @@ GAS_PRICE = 1 ...@@ -48,6 +48,18 @@ GAS_PRICE = 1
SENTRY_URL = 'http://2ec54beaab3b4459a1e5afadea070f98:92aee3f5d91e4e66996a3e0792985541@172.17.30.21:9000/54' SENTRY_URL = 'http://2ec54beaab3b4459a1e5afadea070f98:92aee3f5d91e4e66996a3e0792985541@172.17.30.21:9000/54'
MEMCACHED_HOST = '172.17.0.1' MEMCACHED_HOST = '172.17.0.1'
MEMCACHED_PORT = '11211' MEMCACHED_PORT = 11211 # TIENE QUE SER INT
PENDING_TXS_MEMCACHED_KEY = 'pending_txs' PENDING_TXS_MEMCACHED_KEY = 'pending_txs'
TEST_MEMCACHED_HOST = MEMCACHED_HOST
TEST_MEMCACHED_PORT = MEMCACHED_PORT
TEST_PENDING_TXS_MEMCACHED_KEY = 'test_pending_txs'
ELASTIC_APM = {
'SERVICE_NAME': 'TsaApi-dev',
'SERVER_URL': 'http://10.1.100.67:8200',
'DEBUG': True,
}
...@@ -32,4 +32,10 @@ PERMANENT_OTS_PREFIX = '1x' ...@@ -32,4 +32,10 @@ PERMANENT_OTS_PREFIX = '1x'
GAS = 250000 GAS = 250000
GAS_PRICE = 1 GAS_PRICE = 1
SENTRY_URL = 'http://aa30f3ecd3bb4923a7046f197da61e07:47cd9f9ea1e243f6a9f47e2aa40b85c3@10.1.100.118:9000/82' SENTRY_URL = 'http://aa30f3ecd3bb4923a7046f197da61e07:47cd9f9ea1e243f6a9f47e2aa40b85c3@10.1.100.118:9000/82'
\ No newline at end of file
ELASTIC_APM = {
'SERVICE_NAME': 'TsaApi-pp',
'SERVER_URL': 'http://10.20.99.87:8200',
'DEBUG': True,
}
...@@ -41,4 +41,10 @@ PERMANENT_OTS_PREFIX = '1x' ...@@ -41,4 +41,10 @@ PERMANENT_OTS_PREFIX = '1x'
GAS = 250000 GAS = 250000
GAS_PRICE = 1 GAS_PRICE = 1
SENTRY_URL = 'http://36f4f241a007447d8a4441a13055b110:136cb6d1af854b869d13610603fa7321@10.1.100.118:9000/84' SENTRY_URL = 'http://36f4f241a007447d8a4441a13055b110:136cb6d1af854b869d13610603fa7321@10.1.100.118:9000/84'
\ No newline at end of file
ELASTIC_APM = {
'SERVICE_NAME': 'TsaApi',
'SERVER_URL': 'http://10.20.99.87:8200',
'DEBUG': False,
}
...@@ -24,11 +24,9 @@ import os ...@@ -24,11 +24,9 @@ import os
import datetime import datetime
import raven import raven
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production # Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
...@@ -40,7 +38,6 @@ DEBUG = True ...@@ -40,7 +38,6 @@ DEBUG = True
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']
# Application definition # Application definition
INSTALLED_APPS = [ INSTALLED_APPS = [
...@@ -54,9 +51,12 @@ INSTALLED_APPS = [ ...@@ -54,9 +51,12 @@ INSTALLED_APPS = [
'raven.contrib.django.raven_compat', 'raven.contrib.django.raven_compat',
'corsheaders', 'corsheaders',
'rest_framework_swagger', 'rest_framework_swagger',
'elasticapm.contrib.django'
'app'
] ]
MIDDLEWARE = [ MIDDLEWARE = [
'elasticapm.contrib.django.middleware.TracingMiddleware',
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
...@@ -89,7 +89,6 @@ TEMPLATES = [ ...@@ -89,7 +89,6 @@ TEMPLATES = [
WSGI_APPLICATION = 'TsaApi.wsgi.application' WSGI_APPLICATION = 'TsaApi.wsgi.application'
# Database # Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
...@@ -100,7 +99,6 @@ DATABASES = { ...@@ -100,7 +99,6 @@ DATABASES = {
} }
} }
# Password validation # Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
...@@ -125,6 +123,7 @@ AUTH_PASSWORD_VALIDATORS = [ ...@@ -125,6 +123,7 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE = 'es' LANGUAGE_CODE = 'es'
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
LANGUAGES = ( LANGUAGES = (
('es', _('Spanish')), ('es', _('Spanish')),
) )
...@@ -141,14 +140,11 @@ USE_L10N = True ...@@ -141,14 +140,11 @@ USE_L10N = True
USE_TZ = True USE_TZ = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/ # https://docs.djangoproject.com/en/1.11/howto/static-files/
STATIC_URL = '/static/' STATIC_URL = '/static/'
# Habilitar para permitir la autenticación # Habilitar para permitir la autenticación
REST_FRAMEWORK = { REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': ( 'DEFAULT_PERMISSION_CLASSES': (
...@@ -164,10 +160,40 @@ REST_FRAMEWORK = { ...@@ -164,10 +160,40 @@ REST_FRAMEWORK = {
SENTRY_URL = 'http://2ec54beaab3b4459a1e5afadea070f98:92aee3f5d91e4e66996a3e0792985541@172.17.30.21:9000/54' SENTRY_URL = 'http://2ec54beaab3b4459a1e5afadea070f98:92aee3f5d91e4e66996a3e0792985541@172.17.30.21:9000/54'
MEMCACHED_HOST = '' MEMCACHED_HOST = ''
MEMCACHED_PORT = '' MEMCACHED_PORT = 0 # OJO, TIENE QUE SER INT, sino REVIENTA MEMCACHED
PENDING_TXS_MEMCACHED_KEY = 'pending_txs' PENDING_TXS_MEMCACHED_KEY = 'pending_txs'
TEST_MEMCACHED_HOST = ''
TEST_MEMCACHED_PORT = ''
TEST_PENDING_TXS_MEMCACHED_KEY = 'test_pending_txs'
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': '/path/to/django/debug.log',
},
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'DEBUG',
'propagate': True,
},
},
}
ELASTIC_APM = {
'SERVICE_NAME' : 'TsaApi',
'SERVER_URL': 'http://10.1.100.67:8200',
'DEBUG': False,
}
try: try:
from TsaApi.local_settings import * from TsaApi.local_settings import *
except ImportError as e: except ImportError as e:
...@@ -175,4 +201,4 @@ except ImportError as e: ...@@ -175,4 +201,4 @@ except ImportError as e:
RAVEN_CONFIG = { RAVEN_CONFIG = {
'dsn': SENTRY_URL, 'dsn': SENTRY_URL,
} }
\ No newline at end of file
...@@ -65,4 +65,5 @@ uritemplate==3.0.0 ...@@ -65,4 +65,5 @@ uritemplate==3.0.0
urllib3==1.23 urllib3==1.23
wcwidth==0.1.7 wcwidth==0.1.7
web3==4.5.0 web3==4.5.0
websockets==5.0.1 websockets==5.0.1
\ No newline at end of file elastic-apm==3.0.0
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment