(metric_tags, resolver)
return {'oids': oids, 'parsed_symbol_tags': parsed_symbol_tags}
Parse the symbol based `metric_tags` section of a config file, and return OIDs to fetch and metric tags to submit.
Parse the symbol based `metric_tags` section of a config file, and return OIDs to fetch and metric tags to submit.
Parse the symbol based metric_tags section of a config file and return OIDs to fetch and metric tags to submit .
def parse_symbol_metric_tags(metric_tags, resolver):
    # type: (List[MetricTag], OIDResolver) -> ParsedSymbolTagsResult
    """
    Parse the symbol based `metric_tags` section of a config file, and return OIDs to fetch and metric tags to submit.
    """
    oids = []  # type: List[OID]
    parsed_symbol_tags = []  # type: List[SymbolTag]

    for metric_tag in metric_tags:
        if 'symbol' not in metric_tag:
            raise ConfigurationError('A metric tag must specify a symbol: {}'.format(metric_tag))

        result = _parse_symbol_metric_tag(metric_tag)

        for name, oid in result.oids_to_resolve.items():
            resolver.register(oid, name)

        oids.append(result.oid)
        parsed_symbol_tags.append(result.symbol_tag)

    return {'oids': oids, 'parsed_symbol_tags': parsed_symbol_tags}
def parse_symbol_metric_tags ( metric_tags , resolver ) : # type: (List[MetricTag], OIDResolver) -> ParsedSymbolTagsResult oids = [ ] # type: List[OID] parsed_symbol_tags = [ ] # type: List[SymbolTag] for metric_tag in metric_tags : if 'symbol' not in metric_tag : raise ConfigurationError ( 'A metric tag must specify a symbol: {}' . format ( metric_tag ) ) result = _parse_symbol_metric_tag ( metric_tag ) for name , oid in result . oids_to_resolve . items ( ) : resolver . register ( oid , name ) oids . append ( result . oid ) parsed_symbol_tags . append ( result . symbol_tag ) return { 'oids' : oids , 'parsed_symbol_tags' : parsed_symbol_tags }