-
Notifications
You must be signed in to change notification settings - Fork 156
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
Add methods to retrieve logs from logs-queries/list API endpoint #292
Conversation
Whoops, I should probably link to the API doc: https://docs.datadoghq.com/api/?lang=bash#get-a-list-of-logs |
@sendqueery Thank you for the PR. We have a few folks at Datadog reviewing. |
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.
Hello @sendqueery and thank you for the PR!
I am with the Logs Management team and here are my comments on the business-logic side. Please don't hesitate to @ me if you have questions on my comments.
I'll get someone more familiar with the repo to also review the testing, documentation and code style.
1b59a2b
to
eb7fef4
Compare
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.
Hey, thanks for taking your time to open a PR. Overall it looks great, I just left couple minor points throughout the code to improve some bits.
a2c6dea
to
89b23c4
Compare
@bkabrda I also changed the naming of |
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.
LGTM now, thanks for addressing all the comments. Merging.
The datadog web interface only allows a user to export up to 5k log lines at a time. Sometimes, you just need more than that. This PR adds functionality that allows a user to hit the
logs-queries/list
API and retrieve any number of logs, along with the corresponding tags and attributes for each.As this particular API only returns up to 1000 lines at a time,
GetLogsListPages()
handles the pagination and can retrieve all results.This has appropriate tests and mock JSON response data, and has been successfully tested for use in a small scraper tool I'm writing for internal use at work.