Coder Social home page Coder Social logo

Comments (4)

jaidisido avatar jaidisido commented on May 28, 2024

The wr.cloudwatch.describe_log_streams API already implements next_token and can return all items. 50 is the limit for each pagination call, not the overall limit. It's enforced by the underlying boto3 API (see Limit in the link you shared).

from aws-sdk-pandas.

AlJohri avatar AlJohri commented on May 28, 2024

Thanks @jaidisido! I realize my confusion is with the word limit which I didn't interpret to be a page size.

I have a log group with hundreds of thousands of log streams. How do I get the latest 1000 log streams ordered by LastEventTime? I would have expected the limit parameter to allow me to stop the pagination after 1000 events collected.

wr.cloudwatch.describe_log_streams(
    log_group_name="/my/log/group",
    order_by='LastEventTime',
    descending=True,
)

from aws-sdk-pandas.

jaidisido avatar jaidisido commented on May 28, 2024

I see. We are limited by what the underlying boto3 calls exposes I am afraid. The read_logs API might give you more flexibility in the query perhaps.

from aws-sdk-pandas.

AlJohri avatar AlJohri commented on May 28, 2024

I think the boto3 API exposes enough nobs to achieve this behavior. Instead of running while "nextToken" in response, we can client side stop paginating requests if some condition is met such as a client side limit or a client side LastEventTime

if this makes sense to you, I can re-open this as a feature request for adding a client side filtering / stop pagination parameter in wr.cloudwatch.describe_log_streams for large log groups

from aws-sdk-pandas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.