Skip to content

feat: support log sets #53

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

Merged
merged 19 commits into from
Sep 25, 2024
Merged

feat: support log sets #53

merged 19 commits into from
Sep 25, 2024

Conversation

ritwikdixit
Copy link
Contributor

Porting functionality from #18 to v1 client

Supports

  • Creating a log set
  • Adding logs to set and finalizing
  • Getting that set, and logs within that set in a paginated manner
  • Adding log set to a run

@ritwikdixit ritwikdixit requested a review from alkasm September 21, 2024 20:31
@ritwikdixit ritwikdixit marked this pull request as draft September 21, 2024 20:31
@ritwikdixit
Copy link
Contributor Author

Note to self to include usage example

@ritwikdixit ritwikdixit marked this pull request as ready for review September 23, 2024 21:56
@ritwikdixit
Copy link
Contributor Author

ritwikdixit commented Sep 24, 2024

Examples:

# these are just tuples that look like (timestamp, log message)
logs = [
    (datetime.now(timezone.utc) - timedelta(seconds=5-i), f"Log message {i}")
    for i in range(5)
]
client = nm.get_default_client()
log_set = client.create_log_set(
    name="log testing", 
    logs=logs, 
    description="description"
)

# add to run
run_rid = ...
run = nm.get_run(run_rid)
run.add_log_set("log tests", log_set)


# Can get a log set by rid
rid = ...
new_log_set = nm.get_log_set(rid)

# view logs in a log set
for new_log in new_log_set.stream_logs():
    print(new_log)

Copy link
Contributor

@alkasm alkasm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a get_log_set() function but not a top-level function to create them yet. We would like to get a feel for what type of log files people are generally uploading so that we can create utilities for that. Unlike upload_csv(), upload_polars(), etc--there's less of an obvious standard for us to upload from a known text format. Could potentially see something like upload_journald() or similar.

@alkasm alkasm merged commit cb1cda3 into main Sep 25, 2024
5 checks passed
@alkasm alkasm deleted the rd/log-sets-v1 branch September 25, 2024 03:33
This was referenced Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants