Extract metric from endpoint and pattern.