-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
migrate sentry to config-based cdk #15345
Changes from 5 commits
932dcac
0c0135b
f473dee
666c170
886c24a
e234a8d
4bd72f1
e1c0ae0
42af817
1f01abc
ddae912
d1c0224
144f816
0010cf3
793521e
52d28fe
d9252ae
7975a89
b582e87
1b34c19
3dadc32
5e9d9fa
bad4dd7
8ed13fc
a53760d
9cfb35d
aa0d777
7a443b2
182e4d8
0a9f825
4f16cb9
5338da3
a2a0db8
37321d6
5a9bb1e
8e062cb
f4a9723
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 |
---|---|---|
@@ -0,0 +1,107 @@ | ||
definitions: | ||
page_size: 50 | ||
schema_loader: | ||
type: JsonSchema | ||
file_path: "./source_sentry/schemas/{{ options.name }}.json" | ||
selector: | ||
type: RecordSelector | ||
extractor: | ||
type: JelloExtractor | ||
transform: "_" | ||
requester: | ||
type: HttpRequester | ||
name: "{{ options['name'] }}" | ||
url_base: "https://{{ config.hostname }}/api/0/" | ||
http_method: "GET" | ||
authenticator: | ||
type: "BearerAuthenticator" | ||
api_token: "{{ config.auth_token }}" | ||
paginator: | ||
type: LimitPaginator | ||
url_base: "*ref(definitions.requester.url_base)" | ||
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. why are we passing url_base to the paginator? 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. a bit of an implementation detail, but it's to replace the base url from the cursor when updating the path. although maybe that could be done in the retriever. left a comment on this |
||
page_size: "*ref(definitions.page_size)" | ||
limit_option: | ||
inject_into: "request_parameter" | ||
field_name: "" | ||
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. a bit absurd to to need this... cursor pagination should be a first-class paginator 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. what does it mean to have an empty field_name? is this correct? 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. the right solution here is probably for |
||
page_token_option: | ||
inject_into: "path" | ||
pagination_strategy: | ||
type: "CursorPagination" | ||
cursor_value: "{{ headers.link.next.cursor }}" | ||
stop_condition: "{{ headers.link.results != true }}" | ||
retriever: | ||
type: SimpleRetriever | ||
name: "{{ options['name'] }}" | ||
primary_key: "{{ options['primary_key'] }}" | ||
|
||
streams: | ||
- type: DeclarativeStream | ||
$options: | ||
name: "events" | ||
girarda marked this conversation as resolved.
Show resolved
Hide resolved
|
||
primary_key: "id" | ||
schema_loader: | ||
$ref: "*ref(definitions.schema_loader)" | ||
retriever: | ||
$ref: "*ref(definitions.retriever)" | ||
record_selector: | ||
$ref: "*ref(definitions.selector)" | ||
requester: | ||
$ref: "*ref(definitions.requester)" | ||
path: "projects/{{config.organization}}/{{config.project}}/events/" | ||
request_options_provider: | ||
request_parameters: | ||
full: "true" | ||
paginator: | ||
$ref: "*ref(definitions.paginator)" | ||
- type: DeclarativeStream | ||
$options: | ||
name: "issues" | ||
primary_key: "id" | ||
schema_loader: | ||
$ref: "*ref(definitions.schema_loader)" | ||
retriever: | ||
$ref: "*ref(definitions.retriever)" | ||
record_selector: | ||
$ref: "*ref(definitions.selector)" | ||
requester: | ||
$ref: "*ref(definitions.requester)" | ||
path: "projects/{{config.organization}}/{{config.project}}/issues/" | ||
request_options_provider: | ||
request_parameters: | ||
statsPeriod: "" | ||
query: "" | ||
paginator: | ||
type: NoPagination | ||
- type: DeclarativeStream | ||
$options: | ||
name: "projects" | ||
primary_key: "id" | ||
schema_loader: | ||
$ref: "*ref(definitions.schema_loader)" | ||
retriever: | ||
$ref: "*ref(definitions.retriever)" | ||
record_selector: | ||
$ref: "*ref(definitions.selector)" | ||
requester: | ||
$ref: "*ref(definitions.requester)" | ||
path: "projects/" | ||
paginator: | ||
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 seems incorrect? https://docs.sentry.io/api/projects/list-your-projects/ has paginatino 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. good catch. also added it to the issues stream |
||
type: NoPagination | ||
- type: DeclarativeStream | ||
$options: | ||
name: "project_detail" | ||
primary_key: "id" | ||
schema_loader: | ||
$ref: "*ref(definitions.schema_loader)" | ||
retriever: | ||
$ref: "*ref(definitions.retriever)" | ||
record_selector: | ||
$ref: "*ref(definitions.selector)" | ||
requester: | ||
$ref: "*ref(definitions.requester)" | ||
path: "projects/{{config.organization}}/{{config.project}}/" | ||
paginator: | ||
type: NoPagination | ||
check: | ||
type: CheckStream | ||
stream_names: ["events"] |
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.
the test account doesn't have enough data to test the pagination...
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.
what about our actual sentry account?
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.
Good idea! I was able to test the pagination on the events stream. The same pagination is used for issues and projects.
project_details
does not have pagination https://docs.sentry.io/api/projects/retrieve-a-project/