Skip to content

API Key and App Key Logged With Failed Requests #274

@CoryOwens

Description

@CoryOwens

Currently, if anything goes wrong with a post to Datadog, the API Key and App Key are logged by multiple modules (e.g. datadog.api, urllib3.connectionpool, urllib3.util.retry, etc.) because they are included in the request URL (e.g. /api/v1/series?api_key=[OBFUSCATED_API_KEY]&application_key=[OBFUSCATED_APP_KEY]).

These keys should be sent as request headers, instead.

[   DEBUG] [datadog.api] [pid:3275 ] [    MainThread] Use `requests` based HTTP client.
[   DEBUG] [urllib3.util.retry] [pid:3275 ] [    MainThread] Converted retries value: 3 -> Retry(total=3, connect=None, read=None, redirect=None, status=None)
[   DEBUG] [urllib3.util.retry] [pid:3275 ] [    MainThread] Incremented Retry for (url='/api/v1/series?api_key=[OBFUSCATED_API_KEY]&application_key=[OBFUSCATED_APP_KEY]'): Retry(total=2, connect=None, read=None, redirect=None, status=None)
[ WARNING] [urllib3.connectionpool] [pid:3275 ] [    MainThread] Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fe8a2e3d5c0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /api/v1/series?api_key=[OBFUSCATED_API_KEY]&application_key=[OBFUSCATED_APP_KEY]
[   DEBUG] [urllib3.util.retry] [pid:3275 ] [    MainThread] Incremented Retry for (url='/api/v1/series?api_key=[OBFUSCATED_API_KEY]&application_key=[OBFUSCATED_APP_KEY]'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
[ WARNING] [urllib3.connectionpool] [pid:3275 ] [    MainThread] Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fe8a2e3d630>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /api/v1/series?api_key=[OBFUSCATED_API_KEY]&application_key=[OBFUSCATED_APP_KEY]
[   DEBUG] [urllib3.util.retry] [pid:3275 ] [    MainThread] Incremented Retry for (url='/api/v1/series?api_key=[OBFUSCATED_API_KEY]&application_key=[OBFUSCATED_APP_KEY]'): Retry(total=0, connect=None, read=None, redirect=None, status=None)
[ WARNING] [urllib3.connectionpool] [pid:3275 ] [    MainThread] Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fe8a2e3d6d8>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /api/v1/series?api_key=[OBFUSCATED_API_KEY]&application_key=[OBFUSCATED_APP_KEY]
[   ERROR] [datadog.api] [pid:3275 ] [    MainThread] Could not request POST https://app.datadoghq.com/api/v1/series: HTTPSConnectionPool(host='app.datadoghq.com', port=443): Max retries exceeded with url: /api/v1/series?api_key=[OBFUSCATED_API_KEY]&application_key=[OBFUSCATED_APP_KEY] (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fe8a2e3d7b8>: Failed to establish a new connection: [Errno -2] Name or service not known',)). Please check the network connection or try again later. If the problem persists, please contact support@datadoghq.com

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions