Ejemplo n.º 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=(
Ejemplo n.º 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, ),
)
Ejemplo n.º 3
0
        getattr(settings, "SENTRY_SIMILARITY_INDEX_REDIS_CLUSTER", None)
        or "similarity",
        namespace="sim:1",
    ),
    Encoder({Frame: get_frame_attributes}),
    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",
Ejemplo n.º 4
0
 ExceptionFeature(lambda exception: map(
     serialize_text_shingle,
     shingle(
         13,
         exception.get('value') or '',
     ),
 )),
 'exception:stacktrace:application-chunks':
 ExceptionFeature(
     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(