Skip to content

feat(logs): add --container-id filter#67

Open
yaseenisolated wants to merge 2 commits intomainfrom
yaseen/logs-container-filter
Open

feat(logs): add --container-id filter#67
yaseenisolated wants to merge 2 commits intomainfrom
yaseen/logs-container-filter

Conversation

@yaseenisolated
Copy link
Copy Markdown
Contributor

Summary

  • New `cerebrium logs --container-id ` flag.
  • The plumbing was already there — `PollingAppLogProvider.ContainerID` flows into the API's `?container=` query param. This just exposes it on the cobra command and threads it through `LogsConfig`.

Test plan

  • `cerebrium logs my-app --container-id ` returns only logs for that container
  • `cerebrium logs my-app` (no flag) is unchanged
  • Works with `--no-follow` and `--since`

🤖 Generated with Claude Code

@yaseenisolated yaseenisolated force-pushed the yaseen/logs-container-filter branch from 75b3d44 to 39ca257 Compare May 5, 2026 15:52
yaseenisolated and others added 2 commits May 5, 2026 18:14
Threads the existing PollingAppLogProvider.ContainerID filter (already
plumbed through to the API's container query param) up to the cobra
command as --container-id. Useful for tailing a single replica when an
app has multiple containers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The backend exact-matches container_id against the full pod name. Users
typically copy a shortened suffix from `containers list` (e.g.
"74d8f9d9cf-nlc5n"), which both fails the "must contain app_id"
validation and wouldn't match anyway.

Look up the app's containers and expand the supplied value to the full
id when it matches as a suffix. Errors out cleanly when the value
matches zero or multiple containers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@yaseenisolated yaseenisolated force-pushed the yaseen/logs-container-filter branch from 39ca257 to ebea3b2 Compare May 5, 2026 16:14
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.

1 participant