зеркало из https://github.com/mozilla/subhub.git
Remove AWS Xray
This commit is contained in:
Родитель
6820a5bd71
Коммит
bb3b1e1887
|
@ -25,7 +25,6 @@ env:
|
|||
global:
|
||||
- BOTO_CONFIG: "/dev/null"
|
||||
- LOG_LEVEL: ERROR
|
||||
- AWS_XRAY_SDK_ENABLED: false
|
||||
- secure: SFiDMqcO61t8pzxWp55WMEhC0keqpxfKcLjN5MZiFTtTB1tZCwnZDBUx8rbnIJfU8MAnUPB0pK/tNQghkJwpdMg05pefD4ZJuprXuRYeH0E6z98eAyOFktZExXQqtxW7ESrvb91Eso/T7tsQb0b4jbsGyhVBHAhhc/kBqyqVfVQmN6tT38NfyLN8kSibybsxp5xoA2NyuPP/c89VC+e5lnrJHECQHf62HdA9vTcySrnX81gkWVTriyJc+vkiVFV0FWwSyl3DfbLkN5qiw85mBs3rop1bViJkJHK3UlXiW5MuDgI1iGTlA8uQMJrjlF3dZ6HKTOYWPgcoKK48losvOTtv7rorhKg8rCHZdmTsaqOzYae8XcrLgBeWphUzVUP32NW4SrdY9JB59L9ht2PoJMoFxMipXkeOqk+GEnCdyiKicewYcT1UsJfpvz4Yw3OReDzKQ//UHNPjFOQ46x0QQKb017H41cM15QerEAiI9PJ/AfZkbxrbrmLvxAUnoahSHQCW6RB7WR04hL4hZ95sY5QhV8cqSkU9iP+SExNbRC8cPcNLU7KYEE4q6hzXwY4ZPjetJSzF1Gp8HfL9C1zh/rpWX0Nxzl54J5aJpdzTXASQdonT9RDIR3gf/bQIou6EKtQLTybgj+9CTr/MxfjjK99pA4MHc0y389+pyEM0Y5M=
|
||||
- secure: jfGlcaBs3vdQ+nycb/JX7JP2nf9vBa7LtA0+Pp6lDm/6V6LrVmF955ldHyaZjMchxQJCinVBOzU5++XWAg0wG/jponQ5ZBpuGpqsefA5y7PDoYk7XZib7VE+PTm5PlPI14JcB5FRgCeDfJQR+XBCgnvCnWM8k2cF5HJEODQovw/r3xkGC6j3IQU1JJkQCT6rTuvZ6GGbxU/bFCrjK1PjQqw3d1qmYfvbLU3dCwYGpL/a3eqwheINIPQq7mtorCHZ7BkN/1B907sIvEH72LUwZgJTckBcbCbxgjKMtGYbYWEoH6DteUTzZo4zok5nTArsMOqYHYRoC9rezMJz8C1f5tB/ktclCgAoiM1QGMr5/6PHrOU61iQms+8SCOZZ6iRql7TGL/6P+zFXMFql6MOQ5JmxwKYXTo36l+QaGeqU4yxzCKoDbpMuUTymP215XaYWC1njQHcOgWdNgzbXOvjWvpgEPa2ivp2/64zOnCsZhHpkwdiNPye4VrefOoOqrSUTNi7fsFmEPFNbrOp/v5QGrpapfPb+w7hIeabrVa5bQyCH/hOQThcpDqaZa9MnD2ZcI53A8tznAScG5k8Ei1CKRjo3ZtSW25dgPr5eDRlWbHEhCWwOvymnw4mFqJVE58m17UOBqgm3MJzWOhJg5PFg/0zqJzgjBEDB0WeLTHpVq/Q=
|
||||
before_install:
|
||||
|
|
|
@ -13,14 +13,10 @@ default:
|
|||
VERSION: ${env:VERSION}
|
||||
REMOTE_ORIGIN_URL: ${env:REMOTE_ORIGIN_URL}
|
||||
LOG_LEVEL: ${env:LOG_LEVEL}
|
||||
NEW_RELIC_ACCOUNT_ID: ${env:NEW_RELIC_ACCOUNT_ID}
|
||||
NEW_RELIC_TRUSTED_ACCOUNT_ID: ${env:NEW_RELIC_TRUSTED_ACCOUNT_ID}
|
||||
NEW_RELIC_SERVERLESS_MODE_ENABLED: ${env:NEW_RELIC_SERVERLESS_MODE_ENABLED}
|
||||
NEW_RELIC_DISTRIBUTED_TRACING_ENABLED: ${env:NEW_RELIC_DISTRIBUTED_TRACING_ENABLED}
|
||||
PROFILING_ENABLED: ${env:PROFILING_ENABLED}
|
||||
PROCESS_EVENTS_HOURS: 6
|
||||
USER_TABLE: ${env:USER_TABLE}
|
||||
DELETED_USER_TABLE: ${env:DELETED_USER_TABLE}
|
||||
EVENT_TABLE: ${env:EVENT_TABLE}
|
||||
STRIPE_REQUEST_TIMEOUT: ${env:STRIPE_REQUEST_TIMEOUT}
|
||||
SENTRY_URL: ${env:SENTRY_URL}
|
||||
SENTRY_URL: ${env:SENTRY_URL}
|
|
@ -20,20 +20,11 @@ sys.path.insert(0, join(dirname(realpath(__file__)), "src"))
|
|||
|
||||
client = Client(os.environ["SENTRY_URL"])
|
||||
|
||||
from aws_xray_sdk.core import xray_recorder, patch_all
|
||||
from aws_xray_sdk.core.context import Context
|
||||
from aws_xray_sdk.ext.flask.middleware import XRayMiddleware
|
||||
|
||||
from hub.app import create_app
|
||||
from shared.log import get_logger
|
||||
|
||||
logger = get_logger()
|
||||
|
||||
xray_recorder.configure(service="fxa.hub")
|
||||
patch_all()
|
||||
|
||||
hub_app = create_app()
|
||||
XRayMiddleware(hub_app.app, xray_recorder)
|
||||
|
||||
# NOTE: The context object has the following available to it.
|
||||
# https://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html#python-context-object-props
|
||||
|
@ -49,4 +40,4 @@ def handle(event, context):
|
|||
)
|
||||
raise
|
||||
finally:
|
||||
logger.info("handling hub event", subhub_event=event, context=context)
|
||||
logger.info("handling hub event", subhub_event=event, context=context)
|
|
@ -16,18 +16,11 @@ sys.path.insert(0, join(dirname(realpath(__file__)), "src"))
|
|||
|
||||
client = Client(os.environ["SENTRY_URL"])
|
||||
|
||||
from aws_xray_sdk.core import xray_recorder, patch_all
|
||||
from aws_xray_sdk.core.context import Context
|
||||
from aws_xray_sdk.ext.flask.middleware import XRayMiddleware
|
||||
|
||||
from hub.verifications import events_check
|
||||
from shared.log import get_logger
|
||||
|
||||
logger = get_logger()
|
||||
|
||||
xray_recorder.configure(service="fxa.mia")
|
||||
patch_all()
|
||||
|
||||
# NOTE: The context object has the following available to it.
|
||||
# https://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html#python-context-object-props
|
||||
# NOTE: Available environment passed to the Flask from serverless-wsgi
|
||||
|
@ -43,4 +36,4 @@ def handle(event, context):
|
|||
)
|
||||
raise
|
||||
finally:
|
||||
logger.info("handling mia event", subhub_event=event, context=context)
|
||||
logger.info("handling mia event", subhub_event=event, context=context)
|
|
@ -104,7 +104,6 @@ custom:
|
|||
plugins:
|
||||
- serverless-python-requirements
|
||||
- serverless-domain-manager
|
||||
- serverless-plugin-tracing
|
||||
- serverless-package-external
|
||||
- serverless-plugin-canary-deployments
|
||||
- serverless-stack-termination-protection
|
||||
|
@ -124,7 +123,6 @@ provider:
|
|||
# Logging documentation:
|
||||
# https://serverless.com/framework/docs/providers/aws/events/apigateway/
|
||||
restApi: true
|
||||
tracing: true
|
||||
memorySize: ${file(functions.yml):${self:provider.stage}.LAMBDA_MEMORY_SIZE}
|
||||
timeout: ${file(functions.yml):${self:provider.stage}.LAMBDA_TIMEOUT}
|
||||
snsaccount: ${file(accounts.yml):fxa.${self:provider.stage}}
|
||||
|
@ -168,12 +166,6 @@ provider:
|
|||
Resource:
|
||||
- 'Fn::Join': [':', ['arn:aws:kms', Ref: AWS::Region, Ref: AWS::AccountId, 'alias/*']]
|
||||
- 'Fn::Join': [':', ['arn:aws:kms', Ref: AWS::Region, Ref: AWS::AccountId, 'key/*']]
|
||||
- Effect: Allow
|
||||
Action:
|
||||
- 'xray:PutTraceSegments'
|
||||
- 'xray:PutTelemetryRecords'
|
||||
Resource:
|
||||
- '*'
|
||||
- Effect: Allow
|
||||
Action:
|
||||
- sns:Publish
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
# requirements for hub.application to run
|
||||
# do not add testing reqs or automation reqs here
|
||||
attrdict==2.0.1
|
||||
aws-xray-sdk==2.4.2
|
||||
boto3==1.9.245
|
||||
botocore==1.12.245
|
||||
cachetools==3.1.1
|
||||
|
|
|
@ -9,8 +9,6 @@ from abc import ABC
|
|||
from datetime import datetime, timedelta
|
||||
from typing import Dict, Any
|
||||
from flask import current_app
|
||||
from aws_xray_sdk.core import xray_recorder
|
||||
from aws_xray_sdk.ext.flask.middleware import XRayMiddleware
|
||||
|
||||
from hub.app import create_app, g
|
||||
from hub.vendor.controller import event_process
|
||||
|
@ -20,11 +18,9 @@ from shared.log import get_logger
|
|||
logger = get_logger()
|
||||
|
||||
if not hasattr(sys, "_called_from_test"):
|
||||
xray_recorder.configure(service="subhub-missing-events")
|
||||
|
||||
try:
|
||||
app = create_app()
|
||||
XRayMiddleware(app.app, xray_recorder)
|
||||
except Exception: # pylint: disable=broad-except
|
||||
logger.exception("Exception occurred while loading app")
|
||||
raise
|
||||
|
|
1
tox.ini
1
tox.ini
|
@ -25,7 +25,6 @@ passenv =
|
|||
TRAVIS_*
|
||||
USER_TABLE
|
||||
setenv =
|
||||
AWS_XRAY_SDK_ENABLED=false
|
||||
PYTHONDONTWRITEBYTECODE=1
|
||||
envdir = {toxinidir}/venv
|
||||
deps =
|
||||
|
|
Загрузка…
Ссылка в новой задаче