Skip to content

v2 API Access Log Filter Schema is incorrect #2408

@winguse

Description

@winguse

v2 API Access Log Filter Schema is incorrect

This is the V1 config:

              filter:
                type: logical_and
                filters:
                - type: logical_or
                  filters:
                  - type: status_code
                    op: ">="
                    value: 400
                  - type: status_code
                    op: "="
                    value: 0
                  - type: duration
                    op: ">="
                    value: 2000
                  - type: traceable_request
                - type: not_healthcheck

This is one V2 config I can think of:

            filter:
              and_filter:
                filters:
                  - not_health_check_filter: {}
                  - or_filter:
                      filters:
                        - status_code_filter:
                            comparison:
                              op: GE
                              value:
                                default_value: 300
                                runtime_key: "" # What's this? And this is required.
                        - status_code_filter:
                            comparison:
                              op: EQ
                              value:
                                default_value: 0
                                runtime_key: "" # What's this?
                        - duration_filter:
                            comparison:
                              op: GE
                              value:
                                default_value: 2000
                                runtime_key: "" # What's this?
                        - traceable_filter: {}

As searching the code, I can see runtime_key is something like access_log.access_error.status.

And I think the problem here is incorrect use of RuntimeUInt32 inside ComparisonFilter.

RuntimeUInt32.runtime_key looks like is to extract information from log and fall back to
RuntimeUInt32.default_value.

Metadata

Metadata

Assignees

Labels

questionQuestions that are neither investigations, bugs, nor enhancements

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions