-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Remove dogstatsd-python in favor of dogapi #905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -358,6 +358,9 @@ | |
| # Tracking | ||
| 'track', | ||
|
|
||
| # Monitoring | ||
| 'datadog', | ||
|
|
||
| # For asset pipelining | ||
| 'mitxmako', | ||
| 'pipeline', | ||
|
|
||
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,25 @@ | ||
| from django.conf import settings | ||
| from dogapi import dog_http_api, dog_stats_api | ||
|
|
||
| from dogapi import dog_stats_api, dog_http_api | ||
|
|
||
|
|
||
| def run(): | ||
| """ | ||
| Initialize connection to datadog during django startup. | ||
|
|
||
| Expects the datadog api key in the DATADOG_API settings key | ||
| Can be configured using a dictionary named DATADOG in the django | ||
| project settings. | ||
|
|
||
| """ | ||
| if hasattr(settings, 'DATADOG_API'): | ||
| dog_http_api.api_key = settings.DATADOG_API | ||
| dog_stats_api.start(api_key=settings.DATADOG_API, statsd=True) | ||
|
|
||
| # By default use the statsd agent | ||
| options = {'statsd': True} | ||
|
|
||
| if hasattr(settings, 'DATADOG'): | ||
| options.update(settings.DATADOG) | ||
|
|
||
| # Not all arguments are documented. | ||
| # Look at the source code for details. | ||
| dog_stats_api.start(**options) | ||
|
|
||
| dog_http_api.api_key = options.get('api_key') |
13 changes: 8 additions & 5 deletions
13
common/djangoapps/student/management/commands/pearson_import_conf_zip.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 10 additions & 7 deletions
17
common/djangoapps/student/management/commands/pearson_transfer.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if this didn't require a synchronous change on the configuration side in production. For instance, you could load in the
DATADOG_APIkey fromAUTH_TOKENSas a default value into theDATADOGdictionary (or if theDATADOGdictionary doesn't exist).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there are still two Pearson commands that reference DATADOG_API. Should these just be changed to use DATADOG instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpennington I had that at some point, but end up removing it thinking that it is better to request a change from devops than to provide support for both options. I'll make the change you mention first and request the change, that way we can remove DATADOG_API at some point.
@brianhw I haven't had time to go over the Pearson app yet. I'll ping you when I update it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that sounds good. We want to be able to remove the old settings, but not require that the settings be updated simultaneously as the code is deployed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed