Skip to content

feat: Adopt TraceExporter's Telemetry stuff - #183

Open
Aaalibaba42 wants to merge 5 commits into
mainfrom
jwiriath/telemetry
Open

feat: Adopt TraceExporter's Telemetry stuff#183
Aaalibaba42 wants to merge 5 commits into
mainfrom
jwiriath/telemetry

Conversation

@Aaalibaba42

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

Overall package size

Self size: 30.38 MB
Deduped: 30.38 MB
No deduping: 30.38 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------|

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@Aaalibaba42
Aaalibaba42 marked this pull request as ready for review July 20, 2026 16:56
@Aaalibaba42
Aaalibaba42 requested review from a team as code owners July 20, 2026 16:56

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa886f64ab

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/pipeline/src/lib.rs Outdated
Comment thread crates/pipeline/src/lib.rs Outdated
@Aaalibaba42

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 21, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-21 12:31:25 UTC ℹ️ Start processing command /merge


2026-07-21 12:31:31 UTC ℹ️ MergeQueue: waiting for PR to be ready

This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
It will be added to the queue as soon as checks pass and/or get approvals. View in MergeQueue UI.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2026-07-21 12:31:57 UTC ⚠️ MergeQueue: This merge request was unqueued

jules.wiriath@datadoghq.com unqueued this merge request

yannham
yannham previously approved these changes Jul 24, 2026
Comment thread crates/pipeline/src/lib.rs Outdated
Comment thread crates/pipeline/src/lib.rs Outdated
Comment thread crates/pipeline/src/lib.rs Outdated
@datadog-datadog-prod-us1

This comment has been minimized.

builder.set_otlp_headers(headers.clone());
}
}
if let Some(cfg) = self.telemetry_config.take() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is it ok to take it instead of clone? Do we only use the config exactly once? It looks like the next time send_prepared_chunk will be called, telemetry_config will be gone.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

exporter_slot goes from None to Some, so the entire build block is skipped on every subsequent send_prepared_chunk (l529), if the build fails, build_error is latched and the next call returns early before reaching the take (l534), so yes it should be okay by line 563.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ok. I think I was confused by the fact that other values are cloned (headers, otlp endpoint) above instead of being taken out. Is that because we'll need them later?

@Aaalibaba42 Aaalibaba42 Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

From a quick glance, build_error could be a Cell, but the others genuinely borrows from the content. If you think having all RefCell would help readability I don't mind too much, the impact of the borrow counting is probably minimal, otherwise I can make build_error also a Cell

@yannham yannham Jul 27, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

but the others genuinely borrows from the content.

But then we clone them, right? self.otlp_protocol.get() clones, and otlp_headers is also cloned L560. So I'm just wondering which possibility is it:

  1. We use all those values otlp_protocol, otlp_headers, telemetry_config exactly only once for the builder. In this case it's strange that they have a different treatment than telemetry_config. We should rather use self.otlp_protocol.take() and std::mem::take(self.otlp_headers.borrow_mut()). Maybe it doesn't really matter for OtlpProtcol which is stack-allocated anyway, but the headers are a vec, so it does avoid a clone. And in that situation in fact the otlp_headers should probably not even be a RefCell, but a Cell? Unless it's built in several steps?

  2. Some of these values are re-used elsewhere afterwards, so we need to let them live in self. Then the current version makes sense, and this was basically my question above

    Is that because we'll need them later?

    It's just not obvious that e.g. headers and telemetry_config should be treated differently

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah you are right it's situation 1, otlp_protocol is Copy and otlp_headers is cloned, they should also be Cells for I don't think they are reused elsewhere

bengl
bengl previously approved these changes Jul 27, 2026
@Aaalibaba42

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 28, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-28 09:35:48 UTC ℹ️ Start processing command /merge


2026-07-28 09:35:53 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 0s (p90).


2026-07-28 09:36:06 UTCMergeQueue: This merge request has conflicts

This merge request conflicts with another merge request ahead in the queue.

The merge requests in front of this one are:

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants