<!-- Love localstack? Please consider supporting our collective:
👉  https://opencollective.com/localstack/donate -->

# Type of request: This is a ...

[x ] bug report
[ ] feature request

# Detailed description

Not able to use the edge service to write metric data to cloudwatch via the javascript aws-sdk.

However, It **DOES** work when using the deprecated cloudwatch port.

## Expected behavior

Metric data to be visible when calling `awslocal cloudwatch list-metrics`

## Actual behavior

404 from edge service. No metric data is persisted, localstack instance logs the following info:

```
INFO:localstack.services.edge: Unable to determine forwarding port for API "monitoring" - please make sure this API is enabled via the SERVICES configuration
```

# Steps to reproduce

Run JS code in "Client code" section.
See 404 Error

## Command used to start LocalStack

`TMPDIR=/tmp/localstack docker-compose up`

## Client code (AWS SDK code snippet, or sequence of "awslocal" commands)

```js
const AWS = require('aws-sdk')
const cw = new AWS.CloudWatch({
  endpoint: 'http://localhost:4566',
})

const data = {
  Namespace: 'ns',
  MetricData: [
    {
      MetricName: 'metric-name',
      Timestamp: new Date(),
      Value: 12345,
      Unit: 'Milliseconds',
      Dimensions: [
        { Name: 'Environment', Value: 'local' },
      ]
    }
  ]
}

cw.putMetricData(data, (err, data) => {
  if (err) {
      console.log('Error', err)
  } else {
      console.log('Success', JSON.stringify(data))
  }
})
```

import re
import os
import sys
import json
import logging
from requests.models import Response
from localstack import config
from localstack.constants import HEADER_LOCALSTACK_TARGET, HEADER_LOCALSTACK_EDGE_URL, LOCALSTACK_ROOT_FOLDER
from localstack.utils.common import run, is_root, TMP_THREADS, to_bytes, truncate
from localstack.utils.common import safe_requests as requests
from localstack.services.generic_proxy import ProxyListener, start_proxy_server
LOG = logging.getLogger(__name__)
HEADER_KILL_SIGNAL = 'x-localstack-kill'
class ProxyListenerEdge(ProxyListener):
    def forward_request(self, method, path, data, headers):
        if method == 'OPTIONS':
            return 200
        
        headers.get(HEADER_KILL_SIGNAL) and os._exit(0)
        target = headers.get('x-amz-target', '')
        auth_header = headers.get('authorization', '')
        host = headers.get('host', '')
        headers[HEADER_LOCALSTACK_EDGE_URL] = 'https://%s' % host
        
        api, port, path, host = get_api_from_headers(headers, path)
        if port and int(port) < 0:
            return 404
        if not port:
            port = get_port_from_custom_rules(method, path, data, headers) or port