Repository navigation
feat: add _create_in_project_group to logger options - #837
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| from requests.adapters import HTTPAdapter | ||
|
|
||
| from . import context, id_gen | ||
| from .api._generated.models.projects import CreateProject |
There was a problem hiding this comment.
this will break tests, means we dont lazy load the api.
|
will take this over to fix CI |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df5e6867fc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| # A `project_name:` parent would register the project outside its group. | ||
| if not _id and (self.parent_compute_object_metadata_args or {}).get("project_group_name"): |
There was a problem hiding this comment.
Preserve the group in exported OTel contexts
When an unresolved span from a grouped logger is passed to braintrust.otel.context_from_span_export(), that helper still converts compute_object_metadata_args to project_name:<name> via _get_braintrust_parent() and drops project_group_name. The receiving service will therefore register or route the project outside the requested group—the exact case this new special handling avoids for direct injection. Resolve the grouped project to a project_id in this export-to-OTel path as well.
Useful? React with 👍 / 👎.
init_logger(project="..."), the SDK looks the project up by name and creates it if it doesn't exist yet. This happens lazily, the first time the logger actually needs the project ID.init_loggernow accepts an experimental_create_in_project_groupoption. When it is set, the SDK passesproject_group_namealong with the project name when it registers the project.project_idis passed, because no project is created in that case.project_group_nameisn't in the pinned OpenAPI schema yet. The SDK uses a local extension of the generated request type until it is.