feat(profiling): Publish thread context attribute keys at process start#11558
Conversation
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
This comment has been minimized.
This comment has been minimized.
**What does this PR do?** This PR adjusts the `ProcessContext` setup to match the change in DataDog/java-profiler#576 to publish the context attributes at process start. **Motivation:** Publishing the context attributes at process start enables outside readers of thread context to immediately start reading this information; prior to this change they were impacted by the profiler start delay. **Additional Notes:** This PR relies on the API changes introduced in DataDog/java-profiler#576 and will need to be merged together with an upgrade to the latest java-profiler. **How to test the change?** This change includes test coverage.
a2e009f to
0e2f038
Compare
|
Update: This was failing the build because master had slightly changed in the meanwhile. In particular, I needed to do this: @@ -266,7 +266,8 @@ public final class DatadogProfiler {
if (isWallClockProfilerEnabled(configProvider)) {
profilingModes.add(WALL);
}
- this.orderedContextAttributes = getOrderedContextAttributes(configProvider);
+ Set<String> contextAttributes = getContextAttributes(configProvider);
+ this.orderedContextAttributes = getOrderedContextAttributes(contextAttributes, configProvider);
this.contextSetter = new ContextSetter(profiler, orderedContextAttributes);
// ContextSetter deduplicates and truncates to 10 internally; size arrays to its actual size.
int contextSize = contextSetter.snapshotTags().length;
@@ -307,7 +308,11 @@ public final class DatadogProfiler {
* process context can publish the same {@code attribute_key_map} before the profiler starts.
*/
public static List<String> getOrderedContextAttributes(ConfigProvider configProvider) {
- List<String> ordered = new ArrayList<>(getContextAttributes(configProvider));
+ return getOrderedContextAttributes(getContextAttributes(configProvider), configProvider);
+ }
+
+ private static List<String> getOrderedContextAttributes(Set<String> contextAttributes, ConfigProvider configProvider) {
+ List<String> ordered = new ArrayList<>(contextAttributes);
if (isSpanNameContextAttributeEnabled(configProvider)) {
ordered.add(OPERATION);
}as now a new user of Since the history on the branch was getting a bit weird, I squash/rebased-this on top of current master. |
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
[email protected] cancelled this merge request build |
|
/merge --cancel |
|
View all feedbacks in Devflow UI.
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
The merge request has been interrupted because the build 5567830630602077201 took longer than expected. The current limit for the base branch 'master' is 120 minutes. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
…rt (#11558) [PROF-14883] Publish thread context attribute keys at process start **What does this PR do?** This PR adjusts the `ProcessContext` setup to match the change in DataDog/java-profiler#576 to publish the context attributes at process start. **Motivation:** Publishing the context attributes at process start enables outside readers of thread context to immediately start reading this information; prior to this change they were impacted by the profiler start delay. **Additional Notes:** This PR relies on the API changes introduced in DataDog/java-profiler#576 and will need to be merged together with an upgrade to the latest java-profiler. **How to test the change?** This change includes test coverage. Make spotless happy Co-authored-by: ivo.anjo <[email protected]>
What Does This Do
This PR adjusts the
ProcessContextsetup to match the change in DataDog/java-profiler#576 to publish the context attributes at process start.Motivation
Publishing the context attributes at process start enables outside readers of thread context to immediately start reading this information; prior to this change they were impacted by the profiler start delay.
Additional Notes
This PR relies on the API changes introduced in
DataDog/java-profiler#576 and will need to be merged together with an upgrade to the latest java-profiler.
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issue/merge. You can also:/merge --commit-message "..."/merge -c/merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)Jira ticket: PROF-14883