Skip to content

chore: remove static Orleans meter#10201

Merged
ReubenBond merged 5 commits into
dotnet:mainfrom
Meir017:measurables-remove-static-meter
Jun 11, 2026
Merged

chore: remove static Orleans meter#10201
ReubenBond merged 5 commits into
dotnet:mainfrom
Meir017:measurables-remove-static-meter

Conversation

@Meir017

@Meir017 Meir017 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

closes #9608 by removing the static Orleans meter entirely.

This deletes Orleans.Runtime.Instruments, removes the generated API surface for it, converts transaction statistics to use OrleansInstruments when resolved from DI, and leaves direct-construction compatibility paths on per-instance meters instead of a shared static meter.

Depends on #10199 and #10200 to finish moving the remaining provider-created stream monitors to DI-created meters.

Microsoft Reviewers: Open in CodeFlow

@Meir017 Meir017 mentioned this pull request Jun 10, 2026
24 tasks
@Meir017

Meir017 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@ReubenBond I'd like your feedback on the compatibility fallback constructors in this PR.

Right now, after removing the static Instruments.Meter, the existing direct-construction paths fall back to creating a new meter, eg:

: this(dimensions, new Meter("Microsoft.Orleans"))

That feels questionable: it avoids the static meter, but it still creates ad-hoc meters outside IMeterFactory, which is not really aligned with the goal of #9608.

Would you prefer that we make this a breaking cleanup instead and add/require an OrleansInstruments parameter on these constructors so the meter always comes from the DI-created OrleansInstruments instance? In other words, remove the ad-hoc new Meter(...) fallbacks rather than preserving direct-construction compatibility here.

@ReubenBond

ReubenBond commented Jun 10, 2026

Copy link
Copy Markdown
Member

@Meir017 Let's make a compilation break and remove the back-compat ctor

@Meir017

Meir017 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Applied this in 16cc280a9: removed the stream monitor back-compat constructors which created ad-hoc meters, and updated the default Memory/Generator factories to always pass OrleansInstruments.

The affected projects build locally for net10.0.

@Meir017 Meir017 force-pushed the measurables-remove-static-meter branch from e8b4476 to 0d9cc42 Compare June 10, 2026 17:17
@Meir017

Meir017 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and pushed a fix for the broad CI failures: #10199 had already added an internal \DefaultQueueAdapterReceiverMonitor(ReceiverMonitorDimensions, OrleansInstruments), and this PR also added a public constructor with the same signature, causing CS0111 across the build. Removed the duplicate internal constructor in \

@ReubenBond ReubenBond added this pull request to the merge queue Jun 10, 2026
@ReubenBond ReubenBond removed this pull request from the merge queue due to a manual request Jun 10, 2026
Meir017 and others added 5 commits June 10, 2026 17:56
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ReubenBond ReubenBond force-pushed the measurables-remove-static-meter branch from f970ad8 to 51dad70 Compare June 11, 2026 01:02
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.

Using IMeterFactory for metrics

2 participants