(metric_name: str, dimensions: Optional[Mapping[str, str]] = None)
return "{metric_name}|{dim_string}".format(metric_name=metric_name, dim_string=",".join(dimension_parts),)
Helper function to generate a key used to reference metric timeseries data in DynamoDB; this key will
    be parsed by ``get_meteorite_identifiers`` to store data in SignalFX.

    :param metric_name: the name of the metric (can include some pre-existing dimensions)
    :param dimensions: dict of dimension names to values; dimensions in the metric name will by overwritten by
        values here
    :returns: string that can be passed to ``get_writer`` as the metric key
Helper function to generate a key used to reference metric timeseries data in DynamoDB; this key will
    be parsed by ``get_meteorite_identifiers`` to store data in SignalFX.
Helper function to generate a key used to reference metric timeseries data in DynamoDB ; this key will be parsed by get_meteorite_identifiers to store data in SignalFX .
def generate_key_with_dimensions(metric_name: str, dimensions: Optional[Mapping[str, str]] = None) -> str:
    """ Helper function to generate a key used to reference metric timeseries data in DynamoDB; this key will
    be parsed by ``get_meteorite_identifiers`` to store data in SignalFX.

    :param metric_name: the name of the metric (can include some pre-existing dimensions)
    :param dimensions: dict of dimension names to values; dimensions in the metric name will by overwritten by
        values here
    :returns: string that can be passed to ``get_writer`` as the metric key
    """
    if not dimensions:
        return metric_name

    # dimensions passed in override dimensions in the name
    metric_name, new_dimensions = _parse_dimensions(metric_name)
    new_dimensions.update(dimensions)

    dimension_parts = []
    for key, value in sorted(new_dimensions.items()):
        dimension_parts.append("{key}={value}".format(key=key, value=value))

    return "{metric_name}|{dim_string}".format(metric_name=metric_name, dim_string=",".join(dimension_parts),)
def generate_key_with_dimensions ( metric_name : str , dimensions : Optional [ Mapping [ str , str ] ] = None ) -> str : if not dimensions : return metric_name # dimensions passed in override dimensions in the name metric_name , new_dimensions = _parse_dimensions ( metric_name ) new_dimensions . update ( dimensions ) dimension_parts = [ ] for key , value in sorted ( new_dimensions . items ( ) ) : dimension_parts . append ( "{key}={value}" . format ( key = key , value = value ) ) return "{metric_name}|{dim_string}" . format ( metric_name = metric_name , dim_string = "," . join ( dimension_parts ) , )