Skip to content

[File based config] Snapshot profiling span processor implementation - #2542

Merged
robsunday merged 3 commits into
signalfx:mainfrom
robsunday:fbc-snapshot-span-processor
Nov 26, 2025
Merged

[File based config] Snapshot profiling span processor implementation#2542
robsunday merged 3 commits into
signalfx:mainfrom
robsunday:fbc-snapshot-span-processor

Conversation

@robsunday

Copy link
Copy Markdown
Contributor

Snapshot profiling span processor can be used in YAML with the following snippet:

tracer_provider:
  processors:
    - splunk_snapshot_profiling:

@robsunday
robsunday requested review from a team as code owners November 21, 2025 09:21
Comment on lines +26 to +34
private final TraceRegistry traceRegistry;

public SnapshotProfilingSpanProcessorComponentProvider() {
this(TraceRegistryHolder.getTraceRegistry());
}

SnapshotProfilingSpanProcessorComponentProvider(TraceRegistry traceRegistry) {
this.traceRegistry = traceRegistry;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think that you actually need to hold this global static in a field on this class -- just call TraceRegistryHolder.getTraceRegistry() in the create() method below right?

@robsunday robsunday Nov 25, 2025

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.

The clue of TraceRegistryHolder class and static instance of TraceRegistry is to share this instance between SnapshotProfilingConfigurationCustomizerProvider and SnapshotProfilingSpanProcessorComponentProvider, which is impossible via YAML and ComponentProvider SPI.
This is not obvious and I should make a comment about it in code review initially.

@breedx-splk breedx-splk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Had one comment to make things a bit more tidy, but looks fine overall.


package com.splunk.opentelemetry.profiler.snapshot;

class TraceRegistryHolder {

@laurit laurit Nov 25, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Rest of the code uses ConfigurableSupplier in similar situations. I have a feeling that the existing code might be overcomplicating things we may need to revisit it at one point and see whether it could be improved.

@robsunday
robsunday merged commit 19cfdf1 into signalfx:main Nov 26, 2025
28 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants