-
Notifications
You must be signed in to change notification settings - Fork 65
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
Update Querying API docs based on additional feedback on #405 #410
Conversation
Deploying logfire-docs with Cloudflare Pages
|
docs/guides/advanced/query_api.md
Outdated
@@ -79,7 +79,7 @@ Here's an example of how to use these clients: | |||
# Retrieve data in arrow format, and load into a polars DataFrame | |||
# Note that JSON columns such as `attributes` will be returned as | |||
# JSON-serialized strings | |||
df_from_arrow = pl.from_arrow(await client.query_arrow(sql=query)) | |||
df_from_arrow = pl.from_arrow(await client.query_arrow(sql=query)) # type: ignore |
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.
# type: ignore
in docs????
docs/guides/advanced/query_api.md
Outdated
- **`limit`**: An optional parameter to limit the number of rows returned by the query. If not specified, **the default limit is 500**. The maximum allowed value is 10,000. | ||
- **`row_oriented`**: Only affects JSON responses. If set to `true`, the JSON response will be row-oriented; otherwise, it will be column-oriented. | ||
- **`sql`**: The SQL query to execute. This is the only required query parameter. | ||
- **`min_timestamp`**: An optional ISO-format timestamp to filter records with `start_timestamp` greater than this value for the `records` table or `recorded_timestamp` greater than this value for the `metrics` table. The same filtering can also be done manually within the query itself. |
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.
Does this now have a default that should be documented?
docs/guides/advanced/query_api.md
Outdated
@@ -197,22 +194,21 @@ else: | |||
|
|||
### Additional Configuration | |||
|
|||
The Logfire API supports various query parameters and response formats to give you flexibility in how you retrieve your data: | |||
The Logfire API supports various response formats and query parameters to give you flexibility in how you retrieve your data: | |||
|
|||
- **Response Format**: Use the `Accept` header to specify the response format. Supported values include: |
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.
I don't think multiple levels of bullet point work in mkdocs by default.
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 seems to be working: https://4d3d712c.logfire-docs.pages.dev/guides/advanced/query_api/#additional-configuration
docs/guides/advanced/query_api.md
Outdated
'Authorization': f'Bearer {read_token}', | ||
'Content-Type': 'application/json' | ||
} | ||
headers = {'Authorization': f'Bearer {read_token}'} |
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.
Are you sure we don't need the Accept
header?
d8fd6e1
to
943b604
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #410 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 131 131
Lines 9782 9782
Branches 1289 1289
=========================================
Hits 9782 9782 ☔ View full report in Codecov by Sentry. |
@@ -197,22 +194,21 @@ else: | |||
|
|||
### Additional Configuration | |||
|
|||
The Logfire API supports various query parameters and response formats to give you flexibility in how you retrieve your data: | |||
The Logfire API supports various response formats and query parameters to give you flexibility in how you retrieve your data: |
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.
why were these swapped lol
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.
to match the order the bullets occur below
4b6a121
to
7b6d6fc
Compare
Address Samuel's feedback on #405.
I'll note that I am fairly confident the
Accept
header is not required, but the default value sent by requests and various other tools is or contains*/*
; I have a PR open on the platform in order to send JSON when the Accept header contains this.