예제 #1
0
    BidirectionalMapping({
        "exception:message:character-shingles": "a",
        "exception:stacktrace:application-chunks": "b",
        "exception:stacktrace:pairs": "c",
        "message:message:character-shingles": "d",
    }),
    {
        "exception:message:character-shingles":
        ExceptionFeature(lambda exception: text_shingle(5, exception.value)),
        "exception:stacktrace:application-chunks":
        ExceptionFeature(lambda exception: get_application_chunks(exception)),
        "exception:stacktrace:pairs":
        ExceptionFeature(
            lambda exception: shingle(2, exception.stacktrace.frames)),
        "message:message:character-shingles":
        MessageFeature(lambda message: text_shingle(5, message.formatted)),
    },
    expected_extraction_errors=(InterfaceDoesNotExist, ),
    expected_encoding_errors=(FrameEncodingError, ),
)

features2 = GroupingBasedFeatureSet(
    _make_index_backend(
        getattr(settings, "SENTRY_SIMILARITY2_INDEX_REDIS_CLUSTER", None)
        or getattr(settings, "SENTRY_SIMILARITY_INDEX_REDIS_CLUSTER", None)
        or "similarity",
        namespace="sim:2",
    ))


def _build_dispatcher(methodname):
예제 #2
0
    BidirectionalMapping({
        'exception:message:character-shingles': 'a',
        'exception:stacktrace:application-chunks': 'b',
        'exception:stacktrace:pairs': 'c',
        'message:message:character-shingles': 'd',
    }),
    {
        'exception:message:character-shingles':
        ExceptionFeature(lambda exception: text_shingle(
            5,
            exception.value,
        ), ),
        'exception:stacktrace:application-chunks':
        ExceptionFeature(
            lambda exception: get_application_chunks(exception), ),
        'exception:stacktrace:pairs':
        ExceptionFeature(
            lambda exception: shingle(
                2,
                exception.stacktrace.frames,
            ), ),
        'message:message:character-shingles':
        MessageFeature(lambda message: text_shingle(
            5,
            message.message,
        ), ),
    },
    expected_extraction_errors=(InterfaceDoesNotExist, ),
    expected_encoding_errors=(FrameEncodingError, ),
)
예제 #3
0
파일: __init__.py 프로젝트: rmr1154/sentry
            "exception:stacktrace:pairs": "c",
            "message:message:character-shingles": "d",
        }
    ),
    {
        "exception:message:character-shingles": ExceptionFeature(
            lambda exception: text_shingle(5, exception.value)
        ),
        "exception:stacktrace:application-chunks": ExceptionFeature(
            lambda exception: get_application_chunks(exception)
        ),
        "exception:stacktrace:pairs": ExceptionFeature(
            lambda exception: shingle(2, exception.stacktrace.frames)
        ),
        "message:message:character-shingles": MessageFeature(
            lambda message: text_shingle(5, message.formatted)
        ),
    },
    expected_extraction_errors=(InterfaceDoesNotExist,),
    expected_encoding_errors=(FrameEncodingError,),
)

features2 = GroupingBasedFeatureSet(
    _make_index_backend(
        getattr(settings, "SENTRY_SIMILARITY2_INDEX_REDIS_CLUSTER", None)
        or getattr(settings, "SENTRY_SIMILARITY_INDEX_REDIS_CLUSTER", None)
        or "similarity",
        namespace="sim:2",
    )
)
예제 #4
0
    {
        'exception:message:character-shingles': ExceptionFeature(
            lambda exception: text_shingle(
                5,
                exception.value,
            ),
        ),
        'exception:stacktrace:application-chunks': ExceptionFeature(
            lambda exception: get_application_chunks(exception),
        ),
        'exception:stacktrace:pairs': ExceptionFeature(
            lambda exception: shingle(
                2,
                exception.stacktrace.frames,
            ),
        ),
        'message:message:character-shingles': MessageFeature(
            lambda message: text_shingle(
                5,
                message.message,
            ),
        ),
    },
    expected_extraction_errors=(
        InterfaceDoesNotExist,
    ),
    expected_encoding_errors=(
        FrameEncodingError,
    ),
)
예제 #5
0
            lambda exception: map(
                lambda frames: FRAME_SEPARATOR.join(
                    map(
                        serialize_frame,
                        frames,
                    ), ),
                get_application_chunks(exception),
            ), ),
        'exception:stacktrace:pairs':
        ExceptionFeature(
            lambda exception: map(
                FRAME_SEPARATOR.join,
                shingle(
                    2,
                    map(
                        serialize_frame,
                        get_exception_frames(exception),
                    ),
                ),
            ), ),
        'message:message:character-shingles':
        MessageFeature(
            lambda message: map(
                serialize_text_shingle,
                shingle(
                    13,
                    message['message'],
                ),
            ), ),
    })