<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def build_messages_metrics(messages):
 """Build reports's metrics"""

    count_types = collections.Counter(
        line.get('type') or None
        for line in messages)
    count_modules = collections.Counter(
        line.get('module') or None
        for line in messages)
    count_symbols = collections.Counter(
        line.get('symbol') or None
        for line in messages)
    count_paths = collections.Counter(
        line.get('path') or None
        for line in messages)

    return {
        'types': count_types,
        'modules': count_modules,
        'symbols': count_symbols,
        'paths': count_paths,
    }