def platform_url(host='platform-api.newrelic.com', port=None, ssl=True):
    """Returns the URL for talking to the data collector when reporting
    platform metrics.

    """

    url = '%s://%s/platform/v1/metrics'

    scheme = ssl and 'https' or 'http'
    server = port and '%s:%d' % (host, port) or host

    return url % (scheme, server)