Skip to content

app: Setup prom registry for use in balancers#2555

Merged
olix0r merged 1 commit intomainfrom
ver/prom-registry
Dec 8, 2023
Merged

app: Setup prom registry for use in balancers#2555
olix0r merged 1 commit intomainfrom
ver/prom-registry

Conversation

@olix0r
Copy link
Member

@olix0r olix0r commented Dec 8, 2023

This change updates application initialization to instantiate a prometheus registry that is then passed (as a reference) to the proxy stack builders to register metrics during initialization. The registry is then passed to the admin server's metrics export in an Arc.

This approach is preferable to using a RwLock, as it eliminates a potential deadlock condition.

No functional changes.

@olix0r olix0r requested a review from a team as a code owner December 8, 2023 22:25
This change updates application initialization to instantiate a
prometheus registry that is then passed (as a reference) to the proxy
stack builders to register metrics during initialization. The registry
is then passed to the admin server's metrics export in an Arc.

This approach is preferable to using a RwLock, as it eliminates a
potential deadlock condition.

No functional changes.
@olix0r olix0r force-pushed the ver/prom-registry branch from cbbae87 to af1aa9f Compare December 8, 2023 22:30
@codecov
Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Merging #2555 (af1aa9f) into main (b0643d5) will decrease coverage by 0.02%.
The diff coverage is 79.64%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2555      +/-   ##
==========================================
- Coverage   67.72%   67.71%   -0.02%     
==========================================
  Files         331      331              
  Lines       14818    14838      +20     
==========================================
+ Hits        10035    10047      +12     
- Misses       4783     4791       +8     
Files Coverage Δ
linkerd/app/core/src/config.rs 100.00% <ø> (ø)
linkerd/app/core/src/control.rs 90.58% <100.00%> (ø)
linkerd/app/core/src/metrics.rs 98.43% <100.00%> (-0.06%) ⬇️
linkerd/app/gateway/src/http.rs 79.68% <100.00%> (ø)
linkerd/app/gateway/src/http/tests.rs 100.00% <ø> (ø)
linkerd/app/inbound/src/server.rs 92.85% <100.00%> (-0.48%) ⬇️
linkerd/app/outbound/src/http.rs 66.66% <100.00%> (ø)
linkerd/app/outbound/src/http/concrete/balance.rs 85.48% <ø> (ø)
linkerd/app/outbound/src/http/concrete/tests.rs 100.00% <ø> (ø)
linkerd/app/outbound/src/http/endpoint.rs 74.66% <100.00%> (+0.34%) ⬆️
... and 16 more

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0643d5...af1aa9f. Read the comment docs.

@olix0r olix0r merged commit 0ee7e5c into main Dec 8, 2023
@olix0r olix0r deleted the ver/prom-registry branch December 8, 2023 22:42
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Dec 13, 2023
This change culminates recent work to restructure the balancer to use a
PoolQueue so that balancer changes may occur independently of request
processing. This replaces independent discovery buffering so that the
balancer task is responsible for polling discovery streams without
independent buffering. Requests are buffered and processed as soon as
the pool has available backends. Fail-fast circuit breaking is enforced
on the balancer's queue so that requests can't get stuck in a queue
indefinitely.

In general, the new balancer is instrumented directly with metrics, and
the relevant metric name prefix and labelset is provided by the stack.
In addition to detailed queue metrics including request (in-queue)
latency histograms, but also failfast states, discovery updates counts,
and balancer endpoint pool sizes.

---

* outbound: Move queues into the concrete stack (linkerd/linkerd2-proxy#2539)
* metrics: Remove unused features (linkerd/linkerd2-proxy#2542)
* Add the PoolQueue middleware (linkerd/linkerd2-proxy#2540)
* ci: Fixup codecov config (linkerd/linkerd2-proxy#2545)
* ci: Cancel prior runs (linkerd/linkerd2-proxy#2546)
* ci: Skip ARM builds during non-release CI (linkerd/linkerd2-proxy#2547)
* deps: Update tokio, tonic, and prost (linkerd/linkerd2-proxy#2544)
* build(deps): bump tj-actions/changed-files from 40.2.0 to 40.2.1 (linkerd/linkerd2-proxy#2549)
* metrics: Use prometheus-client for proxy_build_info (linkerd/linkerd2-proxy#2551)
* balance: Add a p2c Pool implementation (linkerd/linkerd2-proxy#2541)
* metrics: Export process metrics using prometheus-client (linkerd/linkerd2-proxy#2552)
* linkerd_identity: split `linkerd_identity::Id` into DNS and URI variants (linkerd/linkerd2-proxy#2538)
* outbound: Move HTTP balancer into its own module (linkerd/linkerd2-proxy#2554)
* app: Setup prom registry for use in balancers (linkerd/linkerd2-proxy#2555)
* vscode: Move workspace settings to devcontainer (linkerd/linkerd2-proxy#2557)
* build(deps): bump tj-actions/changed-files from 40.2.1 to 40.2.2 (linkerd/linkerd2-proxy#2556)
* balance: Instrument metrics in pool balancer (linkerd/linkerd2-proxy#2558)
* Enable PoolQueue balancer (linkerd/linkerd2-proxy#2559)

Signed-off-by: Oliver Gould <[email protected]>
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Dec 14, 2023
This change culminates recent work to restructure the balancer to use a
PoolQueue so that balancer changes may occur independently of request
processing. This replaces independent discovery buffering so that the
balancer task is responsible for polling discovery streams without
independent buffering. Requests are buffered and processed as soon as
the pool has available backends. Fail-fast circuit breaking is enforced
on the balancer's queue so that requests can't get stuck in a queue
indefinitely.

In general, the new balancer is instrumented directly with metrics, and
the relevant metric name prefix and labelset is provided by the stack.
In addition to detailed queue metrics including request (in-queue)
latency histograms, but also failfast states, discovery updates counts,
and balancer endpoint pool sizes.

---

* outbound: Move queues into the concrete stack (linkerd/linkerd2-proxy#2539)
* metrics: Remove unused features (linkerd/linkerd2-proxy#2542)
* Add the PoolQueue middleware (linkerd/linkerd2-proxy#2540)
* ci: Fixup codecov config (linkerd/linkerd2-proxy#2545)
* ci: Cancel prior runs (linkerd/linkerd2-proxy#2546)
* ci: Skip ARM builds during non-release CI (linkerd/linkerd2-proxy#2547)
* deps: Update tokio, tonic, and prost (linkerd/linkerd2-proxy#2544)
* build(deps): bump tj-actions/changed-files from 40.2.0 to 40.2.1 (linkerd/linkerd2-proxy#2549)
* metrics: Use prometheus-client for proxy_build_info (linkerd/linkerd2-proxy#2551)
* balance: Add a p2c Pool implementation (linkerd/linkerd2-proxy#2541)
* metrics: Export process metrics using prometheus-client (linkerd/linkerd2-proxy#2552)
* linkerd_identity: split `linkerd_identity::Id` into DNS and URI variants (linkerd/linkerd2-proxy#2538)
* outbound: Move HTTP balancer into its own module (linkerd/linkerd2-proxy#2554)
* app: Setup prom registry for use in balancers (linkerd/linkerd2-proxy#2555)
* vscode: Move workspace settings to devcontainer (linkerd/linkerd2-proxy#2557)
* build(deps): bump tj-actions/changed-files from 40.2.1 to 40.2.2 (linkerd/linkerd2-proxy#2556)
* balance: Instrument metrics in pool balancer (linkerd/linkerd2-proxy#2558)
* Enable PoolQueue balancer (linkerd/linkerd2-proxy#2559)

Signed-off-by: Oliver Gould <[email protected]>
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.

1 participant