Skip to content

LogsAggregateRequest fails due to multiple oneOf exception #360

Description

@brandonmailhiot

Description

The request for aggregated logs below always fails with this error:

  • "datadog_api_client.v2.exceptions.ApiValueError: Invalid inputs given to generate an instance of LogsAggregateBucketValue. Multiple oneOf schemas matched the inputs, but a max of one is allowed."
api = logs_api.LogsApi(client)

body = LogsAggregateRequest(
        compute=[
            LogsCompute(
                aggregation=LogsAggregationFunction("count"),
            ),
        ],
        filter=LogsQueryFilter(
            query='env:production @path:"/v1/graphql" @response_time_ms:[1 TO 10000] @request_body.query:*',
        ),
        group_by=[
            LogsGroupBy(
                facet="@request_body.query",
                limit=1000,
            ),
        ]
    )

api.aggregate_logs(body)

Expected behavior
I expect to get aggregated logs.

Environment and Versions (please complete the following information):

  • MacOS Big Sur v11.2.1
  • Python v3.9.0
  • datadog-api-client v1.0.0-beta.5

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions