-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(discover): Add docs for organization_events #34768
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
Changes from 10 commits
5d5174d
c029730
36ba73b
d95d12b
8e64e14
34929aa
1716b4f
55d33a3
df466f9
1d43cb4
a15876c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| from drf_spectacular.types import OpenApiTypes | ||
| from drf_spectacular.utils import OpenApiParameter | ||
| from rest_framework import serializers | ||
|
|
||
|
|
@@ -17,6 +18,50 @@ class GLOBAL_PARAMS: | |
| type=str, | ||
| location="path", | ||
| ) | ||
| STATS_PERIOD = OpenApiParameter( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think OpenApiParameter maps to URL parameters, not query parameters There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. drf serializers map to query parameters There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so, its what the Based on docs you can do header, cookie or form parameters too: |
||
| name="statsPeriod", | ||
| location="query", | ||
| required=False, | ||
| type=str, | ||
| description="""The period of time for the query, will override the start & end parameters, a number followed by one of: | ||
| - `d` for days | ||
| - `h` for hours | ||
| - `m` for minutes | ||
| - `s` for seconds | ||
| - `w` for weeks | ||
|
|
||
| For example `24h`, to mean query data starting from 24 hours ago to now.""", | ||
| ) | ||
| START = OpenApiParameter( | ||
| name="start", | ||
| location="query", | ||
| required=False, | ||
| type=OpenApiTypes.DATETIME, | ||
| description="The start of the period of time for the query, expected in ISO-8601 format. For example 2001-12-34T12:34:56.7890", | ||
wmak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ) | ||
| END = OpenApiParameter( | ||
| name="end", | ||
| location="query", | ||
| required=False, | ||
| type=OpenApiTypes.DATETIME, | ||
| description="The end of the period of time for the query, expected in ISO-8601 format. For example 2001-12-34T12:34:56.7890", | ||
wmak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ) | ||
| PROJECT = OpenApiParameter( | ||
| name="project", | ||
| location="query", | ||
| required=False, | ||
| many=True, | ||
| type=int, | ||
| description="The ids of projects to filter by. `-1` means all available projects, if parameter omitted means 'My Projects'", | ||
wmak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ) | ||
| ENVIRONMENT = OpenApiParameter( | ||
| name="environment", | ||
| location="query", | ||
| required=False, | ||
| many=True, | ||
| type=str, | ||
| description="The name of environments to filter by.", | ||
| ) | ||
|
|
||
|
|
||
| class SCIM_PARAMS: | ||
|
|
@@ -46,6 +91,51 @@ class ISSUE_ALERT_PARAMS: | |
| ) | ||
|
|
||
|
|
||
| class VISIBILITY_PARAMS: | ||
| QUERY = OpenApiParameter( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this a visibility-only param? I think we use it in several places outside of visibility. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a specific |
||
| name="query", | ||
| location="query", | ||
| required=False, | ||
| type=str, | ||
| description="""The search query for your filter, read more about query syntax [here](https://docs.sentry.io/product/sentry-basics/search/) | ||
wmak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| example: `query=(transaction:foo AND release:abc) OR (transaction:[bar,baz] AND release:def)` | ||
| """, | ||
| ) | ||
| FIELD = OpenApiParameter( | ||
| name="field", | ||
| location="query", | ||
| required=True, | ||
| type=str, | ||
| many=True, | ||
| description="""The fields, functions or equations to request for the query. At most 20 fields can be passed per request. Each field can be one of the following types: | ||
wmak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - a built-in key field, see possible fields in the [properties table](/product/sentry-basics/search/searchable-properties/#properties-table), under any field that is an event property | ||
wmak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - example: `field=transaction` | ||
| - a tag, tags should use the `tag[]` formatting to avoid ambiguity with any fields | ||
wmak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - example: `field=tag[isEnterprise]` | ||
| - a function which will be in the format of `function_name(parameters,...)`, see possible functions in the [query builder documentation](/product/discover-queries/query-builder/#stacking-functions) | ||
wmak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - when a function is included, discover will group by any tags or fields | ||
wmak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - example: `field=count_if(transaction.duration,greater,300)` | ||
| - an equation when prefixed with `equation|`, read more about [equations here](https://docs.sentry.io/product/discover-queries/query-builder/query-equations/) | ||
wmak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - example: `field=equation|count_if(transaction.duration,greater,300) / count() * 100` | ||
| """, | ||
| ) | ||
| SORT = OpenApiParameter( | ||
| name="sort", | ||
| location="query", | ||
| required=False, | ||
| type=str, | ||
| description="What to order the results of the query by. Must be something in the field list, excluding equations.", | ||
wmak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ) | ||
| PER_PAGE = OpenApiParameter( | ||
| name="per_page", | ||
| location="query", | ||
| required=False, | ||
| type=int, | ||
| description="Limit the number of rows to return in the result, maximum allowed is 100", | ||
wmak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ) | ||
|
|
||
|
|
||
| class CURSOR_QUERY_PARAM(serializers.Serializer): # type: ignore | ||
| cursor = serializers.CharField( | ||
| help_text="A pointer to the last object fetched and its' sort order; used to retrieve the next or previous results.", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.