Commit Graph

3386 Commits

Author SHA1 Message Date
katelyn martin 99fb3aa779 fix(ci): replace `tj-actions/changed-files` action
this commit replaces the `changed-files` github action, which has since
been deleted due to a supply-chain attack. for more information, see
the [report].

the report outlines an archived mirror of the original action under
["Recovery Steps"][recovery-steps]. this commit replaces the deleted
action with this archive.

[report]: https://www.stepsecurity.io/blog/harden-runner-detection-tj-actions-changed-files-action-is-compromised
[recovery-steps]: https://www.stepsecurity.io/blog/harden-runner-detection-tj-actions-changed-files-action-is-compromised#next-steps

Signed-off-by: katelyn martin <kate@buoyant.io>
2025-03-15 20:08:12 -04:00
katelyn martin 23784c01a3
chore: use workspace-level package metadata (#3761)
this commit adds a `[workspace.package]` table at the root of the cargo
workspace. constituent manifests are updated to use the workspace-level
metadata.

this is generally a superficial chore, but has a pleasant future upside:
when new rust editions are released (e.g. 2024), we will only need to
update the edition specified at the root of the workspace.

Signed-off-by: katelyn martin <kate@buoyant.io>
2025-03-15 12:54:50 -04:00
dependabot[bot] c5215ad21e
build(deps): bump tj-actions/changed-files from 45.0.7 to 45.0.8 (#3760)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 45.0.7 to 45.0.8.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](dcc7a0cba8...9200e69727)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 11:50:48 -04:00
dependabot[bot] 2ab03e2b95
build(deps): bump tempfile from 3.17.1 to 3.19.0 (#3759)
* build(deps): bump tempfile from 3.17.1 to 3.19.0

Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.17.1 to 3.19.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.17.1...v3.19.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deny.toml): skip rustix v0.38

this commit adds mention of rustix, whose 1.0 release is still
propagating through the ecosystem, to the deny.toml.

nb: this also removes the bitflags directive, which no longer included a
duplicate version.

Signed-off-by: katelyn martin <kate@buoyant.io>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: katelyn martin <kate@buoyant.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: katelyn martin <kate@buoyant.io>
2025-03-14 11:38:13 -04:00
dependabot[bot] 56faf968db
build(deps): bump once_cell from 1.21.0 to 1.21.1 (#3756)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.21.0 to 1.21.1.
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.21.0...v1.21.1)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 11:31:41 -04:00
dependabot[bot] a616e96779
build(deps): bump aligned-vec from 0.6.1 to 0.6.2 (#3757)
Bumps [aligned-vec](https://github.com/sarah-ek/aligned-vec) from 0.6.1 to 0.6.2.
- [Commits](https://github.com/sarah-ek/aligned-vec/commits/v0.6.2)

---
updated-dependencies:
- dependency-name: aligned-vec
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 11:31:15 -04:00
dependabot[bot] 5a373bc569
build(deps): bump tokio-util from 0.7.13 to 0.7.14 (#3758)
Bumps [tokio-util](https://github.com/tokio-rs/tokio) from 0.7.13 to 0.7.14.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-util-0.7.13...tokio-util-0.7.14)

---
updated-dependencies:
- dependency-name: tokio-util
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 11:30:08 -04:00
katelyn martin 11e990ee16
refactor(stack/loadshed): unit test instruments spawned tasks (#3755)
this commit performs a small refactor to one of the unit tests in
`linkerd-stack`'s load-shedding middleware.

this adds a span to the worker tasks spawned in this test, so that
tracing logs can be associated with particular oneshot services.

see #3744 for more information on upgrading our tower dependency. this
is cherry-picked from investigations on that branch related to breaking
changes in 0.5 related to the `Buffer` middleware.

after this change, logs now look like this:

```
; RUST_LOG="trace" cargo test -p linkerd-stack buffer_load_shed -- --nocapture

running 1 test
[     0.002770s] TRACE worker{id=oneshot1}: tower::buffer::service: sending request to buffer worker
[     0.002809s] TRACE worker{id=oneshot2}: tower::buffer::service: sending request to buffer worker
[     0.002823s] TRACE worker{id=oneshot3}: tower::buffer::service: sending request to buffer worker
[     0.002843s] DEBUG worker{id=oneshot4}: linkerd_stack::loadshed: Service has become unavailable
[     0.002851s] DEBUG worker{id=oneshot4}: linkerd_stack::loadshed: Service shedding load
[     0.002878s] TRACE tower::buffer::worker: worker polling for next message
[     0.002885s] TRACE tower::buffer::worker: processing new request
[     0.002892s] TRACE worker{id=oneshot1}: tower::buffer::worker: resumed=false worker received request; waiting for service readiness
[     0.002901s] DEBUG worker{id=oneshot1}: tower::buffer::worker: service.ready=true processing request
[     0.002914s] TRACE worker{id=oneshot1}: tower::buffer::worker: returning response future
[     0.002926s] TRACE tower::buffer::worker: worker polling for next message
[     0.002931s] TRACE tower::buffer::worker: processing new request
[     0.002935s] TRACE worker{id=oneshot2}: tower::buffer::worker: resumed=false worker received request; waiting for service readiness
[     0.002946s] TRACE worker{id=oneshot2}: tower::buffer::worker: service.ready=false delay
[     0.002983s] TRACE worker{id=oneshot5}: tower::buffer::service: sending request to buffer worker
[     0.003001s] DEBUG worker{id=oneshot6}: linkerd_stack::loadshed: Service has become unavailable
[     0.003007s] DEBUG worker{id=oneshot6}: linkerd_stack::loadshed: Service shedding load
[     0.003017s] DEBUG worker{id=oneshot7}: linkerd_stack::loadshed: Service has become unavailable
[     0.003024s] DEBUG worker{id=oneshot7}: linkerd_stack::loadshed: Service shedding load
[     0.003035s] TRACE tower::buffer::worker: worker polling for next message
[     0.003041s] TRACE tower::buffer::worker: resuming buffered request
[     0.003045s] TRACE worker{id=oneshot2}: tower::buffer::worker: resumed=true worker received request; waiting for service readiness
[     0.003052s] DEBUG worker{id=oneshot2}: tower::buffer::worker: service.ready=true processing request
[     0.003060s] TRACE worker{id=oneshot2}: tower::buffer::worker: returning response future
[     0.003068s] TRACE tower::buffer::worker: worker polling for next message
[     0.003073s] TRACE tower::buffer::worker: processing new request
[     0.003077s] TRACE worker{id=oneshot3}: tower::buffer::worker: resumed=false worker received request; waiting for service readiness
[     0.003084s] DEBUG worker{id=oneshot3}: tower::buffer::worker: service.ready=true processing request
[     0.003091s] TRACE worker{id=oneshot3}: tower::buffer::worker: returning response future
[     0.003099s] TRACE tower::buffer::worker: worker polling for next message
[     0.003103s] TRACE tower::buffer::worker: processing new request
[     0.003107s] TRACE worker{id=oneshot5}: tower::buffer::worker: resumed=false worker received request; waiting for service readiness
[     0.003114s] DEBUG worker{id=oneshot5}: tower::buffer::worker: service.ready=true processing request
[     0.003121s] TRACE worker{id=oneshot5}: tower::buffer::worker: returning response future
[     0.003129s] TRACE tower::buffer::worker: worker polling for next message
test loadshed::tests::buffer_load_shed ... ok
```

Signed-off-by: katelyn martin <kate@buoyant.io>
2025-03-13 13:26:21 -04:00
dependabot[bot] 5fa3745b57
build(deps): bump resolv-conf from 0.7.0 to 0.7.1 (#3751)
Bumps [resolv-conf](https://github.com/hickory-dns/resolv-conf) from 0.7.0 to 0.7.1.
- [Commits](https://github.com/hickory-dns/resolv-conf/commits)

---
updated-dependencies:
- dependency-name: resolv-conf
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-13 09:43:41 -04:00
dependabot[bot] e67ac67288
build(deps): bump http from 0.2.11 to 0.2.12 (#3754)
Bumps [http](https://github.com/hyperium/http) from 0.2.11 to 0.2.12.
- [Release notes](https://github.com/hyperium/http/releases)
- [Changelog](https://github.com/hyperium/http/blob/v0.2.12/CHANGELOG.md)
- [Commits](https://github.com/hyperium/http/compare/v0.2.11...v0.2.12)

---
updated-dependencies:
- dependency-name: http
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-13 09:42:47 -04:00
dependabot[bot] a8390b2ee6
build(deps): bump syn from 2.0.99 to 2.0.100 (#3752)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.99 to 2.0.100.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.99...2.0.100)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-13 09:42:08 -04:00
katelyn martin c35cf270cf
chore(deps): address RUSTSEC-2025-0014 (#3750)
this commit replaces `humantime`, which is no longer maintained, with
`jiff`.

see this error when `main` today is built:

```
error[unmaintained]: humantime is unmaintained
   ┌─ /linkerd/linkerd2-proxy/Cargo.lock:78:1
   │
78 │ humantime 2.1.0 registry+https://github.com/rust-lang/crates.io-index
   │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ unmaintained advisory detected
   │
   ├ ID: RUSTSEC-2025-0014
   ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2025-0014
   ├ Latest `humantime` crates.io release is four years old and GitHub repository has
     not seen commits in four years. Question about maintenance status has not gotten
     any reaction from maintainer: https://github.com/tailhook/humantime/issues/31

     ## Possible alternatives

      * [jiff](https://crates.io/crates/jiff) provides same kind of functionality
   ├ Announcement: https://github.com/tailhook/humantime/issues/31
   ├ Solution: No safe upgrade is available!
   ├ humantime v2.1.0
     └── linkerd-http-access-log v0.1.0
         └── linkerd-app-inbound v0.1.0
             ├── linkerd-app v0.1.0
             │   ├── linkerd-app-integration v0.1.0
             │   └── linkerd2-proxy v0.1.0
             ├── linkerd-app-admin v0.1.0
             │   ├── linkerd-app v0.1.0 (*)
             │   └── (dev) linkerd-app-integration v0.1.0 (*)
             └── linkerd-app-gateway v0.1.0
                 └── linkerd-app v0.1.0 (*)

advisories FAILED, bans ok, licenses ok, sources ok
```

see:
  * https://github.com/rustsec/advisory-db/pull/2249.
  * https://github.com/tailhook/humantime/issues/31.

Signed-off-by: katelyn martin <kate@buoyant.io>
2025-03-12 16:05:03 -07:00
dependabot[bot] d3b4ad6362
build(deps): bump dtoa from 1.0.9 to 1.0.10 (#3749)
Bumps [dtoa](https://github.com/dtolnay/dtoa) from 1.0.9 to 1.0.10.
- [Release notes](https://github.com/dtolnay/dtoa/releases)
- [Commits](https://github.com/dtolnay/dtoa/compare/1.0.9...1.0.10)

---
updated-dependencies:
- dependency-name: dtoa
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 09:58:59 -04:00
dependabot[bot] 332e29af5c
build(deps): bump prettyplease from 0.2.29 to 0.2.30 (#3747)
Bumps [prettyplease](https://github.com/dtolnay/prettyplease) from 0.2.29 to 0.2.30.
- [Release notes](https://github.com/dtolnay/prettyplease/releases)
- [Commits](https://github.com/dtolnay/prettyplease/compare/0.2.29...0.2.30)

---
updated-dependencies:
- dependency-name: prettyplease
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 09:58:28 -04:00
dependabot[bot] 6d7b165727
build(deps): bump once_cell from 1.20.3 to 1.21.0 (#3748)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.20.3 to 1.21.0.
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.20.3...v1.21.0)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 09:58:02 -04:00
dependabot[bot] df651278f2
build(deps): bump quote from 1.0.39 to 1.0.40 (#3746)
Bumps [quote](https://github.com/dtolnay/quote) from 1.0.39 to 1.0.40.
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.39...1.0.40)

---
updated-dependencies:
- dependency-name: quote
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 09:57:24 -04:00
Oliver Gould 16b2ff7232
chore(cargo): make prometheus-client a workspace dependency (#3743) 2025-03-11 22:38:39 +00:00
Oliver Gould 46babf0849
chore(metrics): use kubert-prometheus-process metrics (#3742)
kubert-prometheus-process is a new crate that includes all of Linkerd's system
metrics and more. This also helps avoid annoying compilation build issues on
non-Linux systems.
2025-03-11 18:37:17 -04:00
katelyn martin 575ba0008b
chore(deps): use `prometheus-client` v0.23 (#3732)
this updates the prometheus client dependency.

additionally, this commit updates the `kubert-prometheus-tokio`
dependency, so that we agree on the client library in use.

Signed-off-by: katelyn martin <kate@buoyant.io>
2025-03-11 21:42:13 +00:00
Oliver Gould 4c79bdf730
chore(metrics): clean up feature flagging (#3741)
linkerd-metrics exposes a 'stack' feature but uses a 'linkerd-stack' feature
internally. This change cleans this up.
2025-03-11 15:46:39 -04:00
Oliver Gould 87d6d38510
chore(app-core): remove unused linkerd-system dep (#3740) 2025-03-11 19:43:27 +00:00
Oliver Gould ed42c2ad3a
feat(runtime): support CORES_MIN, CORES_MAX, and CORES_MAX_RATIO (#3731)
When the proxy boots up, it needs to select a number of I/O worker threads to
allocate to the runtime. This change adds a new environment variable that allows
this value to scale based on the number of CPUs available on on the host.

A CORES_MAX_RATIO value of 1.0 will allocate one worker thread per CPU core. A
lesser value will allocate fewer worker threads. Values are rounded to the
nearest whole number.

The CORES_MIN value sets a lower bound on the number of worker threads to use.
The CORES_MAX value sets an upper bound.
2025-03-11 18:53:30 +00:00
katelyn martin 13a79167d7
refactor(stack/switch_ready): use `Either<A, B>` future (#3739)
this commit makes a noöp change to the `SwitchReady<A, B>` machinery
provided by our `linkerd-stack` library.

this commit is a small refactor that is intended to pave the way for an
impending upgrade to tower v0.5, which notably includes breaking changes
to the `tower::util::Either<A, B>` service.

as of tower v0.5, by way of https://github.com/tower-rs/tower/pull/637,
the `Either<A, B>` service is no longer itself a `Future`. so, we can
instead use the future provided by `futures`.

for more information, see:
* https://github.com/linkerd/linkerd2/issues/8733
* https://github.com/linkerd/linkerd2-proxy/pull/3504
* https://github.com/linkerd/linkerd2-proxy/pull/3504/files#r1988082658
* https://github.com/tower-rs/tower/pull/637

Signed-off-by: katelyn martin <kate@buoyant.io>
2025-03-11 14:50:51 -04:00
Oliver Gould 1c15dd087d
chore(linkerd2-proxy): always enable multicore features (#3738)
The proxy predates the multi-threaded tokio runtime. When switching to it, we
added a 'multicore' feature to adopt it incrementally. This has been the only
supported configuration for many years now.

This change removes the needless feature flag to simplify the runtime
configuration.
2025-03-11 17:08:26 +00:00
Oliver Gould a683ff5c67
feat(outbound): instrument per-parent connection protocol counts (#3733)
The outbound proxy makes protocol decisions based on the discovery response,
keyed on a "parent" reference.

This change adds a `protocol::metrics` middleware that records connection counts
by parent reference.
2025-03-11 09:49:45 -07:00
dependabot[bot] ec168c3977
build(deps): bump tinyvec from 1.8.1 to 1.9.0 (#3737)
Bumps [tinyvec](https://github.com/Lokathor/tinyvec) from 1.8.1 to 1.9.0.
- [Changelog](https://github.com/Lokathor/tinyvec/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Lokathor/tinyvec/compare/v1.8.1...v1.9.0)

---
updated-dependencies:
- dependency-name: tinyvec
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-11 07:18:58 -07:00
dependabot[bot] 0dc3c8dde4
build(deps): bump indexmap from 2.7.1 to 2.8.0 (#3736)
Bumps [indexmap](https://github.com/indexmap-rs/indexmap) from 2.7.1 to 2.8.0.
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/main/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.7.1...2.8.0)

---
updated-dependencies:
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-11 07:18:47 -07:00
dependabot[bot] f2bc4cd76d
build(deps): bump bytes from 1.10.0 to 1.10.1 (#3735)
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.10.0...v1.10.1)

---
updated-dependencies:
- dependency-name: bytes
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-11 07:18:36 -07:00
dependabot[bot] 72ee0b31d2
build(deps): bump quote from 1.0.38 to 1.0.39 (#3734)
Bumps [quote](https://github.com/dtolnay/quote) from 1.0.38 to 1.0.39.
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.38...1.0.39)

---
updated-dependencies:
- dependency-name: quote
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-11 07:18:23 -07:00
Oliver Gould 64c608ca8d
feat(inbound): record metrics about transport header usage (#3723)
Inbound proxies may receive meshed traffic directly on the proxy's inbound port
with a transport header, informing inbound routing behavior.

This change updates the inbound proxy to record metrics about the usage of
transport headers, including the total number of requests with a transport
header by session protocol and target port.
2025-03-10 14:07:38 -07:00
Oliver Gould 25bc9730ee
feat: instrument HTTP protocol detection metrics (#3722)
This change updates the DetectHttp middleware to record metrics about HTTP
protocol detection. Specfically, it records the the counts of results and a very
coarse histogram of the time taken to detect the protocol.

The inbound, outbound, and admin (via inbound) stacks are updated to record
metrics against the main registry.
2025-03-10 11:12:56 -07:00
Oliver Gould e7c2afd5c1
feat(http/detect)!: error when the socket is closed (#3721)
* refactor(http): consolidate HTTP protocol detection

Linkerd's HTTP protocol detection logic is spread across a few crates: the
linkerd-detect crate is generic over the actual protocol detection logic, and
the linkerd-proxy-http crate provides an implementation. There are no other
implemetations of the Detect interface. This leads to gnarly type signatures in
the form `Result<Option<http::Variant>, DetectTimeoutError>`: simultaneously
verbose and not particularly informative (what does the None case mean exactly).

This commit introduces a new crate, `linkerd-http-detect`, consolidating this
logic and removes the prior implementations. The admin, inbound, and outbound
stacks are updated to use these new types. This work is done in anticipation of
introducing metrics that report HTTP detection behavior.

There are no functional changes.

* feat(http/detect)!: error when the socket is closed

When a proxy does protocol detection, the initial read may indicate that the
connection was closed by the client with no data being written to the socket. In
such a case, the proxy continues to process the connection as if may be proxied,
but we expect this to fail immediately. This can lead to unexpected proxy
behavior: for example, inbound proxies may report policy denials.

To address this, this change surfaces an error (as if the read call failed).
This could, theoretically, impact some bizarre clients that initiate half-open
connections. These corner cases can use explicit opaque policies to bypass
detection.
2025-03-10 08:31:17 -07:00
dependabot[bot] 606b51ba32
build(deps): bump thiserror from 2.0.11 to 2.0.12 (#3728)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 2.0.11 to 2.0.12.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/2.0.11...2.0.12)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 08:02:20 -07:00
dependabot[bot] 3a7d207950
build(deps): bump ryu from 1.0.19 to 1.0.20 (#3729)
Bumps [ryu](https://github.com/dtolnay/ryu) from 1.0.19 to 1.0.20.
- [Release notes](https://github.com/dtolnay/ryu/releases)
- [Commits](https://github.com/dtolnay/ryu/compare/1.0.19...1.0.20)

---
updated-dependencies:
- dependency-name: ryu
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 08:01:36 -07:00
dependabot[bot] 77b21876cd
build(deps): bump serde from 1.0.218 to 1.0.219 (#3727)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.218 to 1.0.219.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.218...v1.0.219)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 08:01:20 -07:00
dependabot[bot] 5a0fe3d221
build(deps): bump time from 0.3.37 to 0.3.39 (#3726)
Bumps [time](https://github.com/time-rs/time) from 0.3.37 to 0.3.39.
- [Release notes](https://github.com/time-rs/time/releases)
- [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md)
- [Commits](https://github.com/time-rs/time/compare/v0.3.37...v0.3.39)

---
updated-dependencies:
- dependency-name: time
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 08:01:02 -07:00
Oliver Gould fc928b637a
feat(inbound): include srv_port label in server metrics (#3725)
We include a group/version/kind for inbound server resources, but we do not
indicate which specific port the server is applied to. This is important context
to understand the inbound proxy's behavior, especially when using the default
servers.

This change adds a `srv_port` label to inbound server metrics to definitively
and consistently indicate the server port used for inbound policy.
2025-03-09 20:40:22 -04:00
Oliver Gould 9f5a6cce27
fix(inbound): correct error message when transport header is missing (#3724)
The RefusedNoTarget error type is a remnant of an older version of the direct
stack. This commit updates the error message to reflect the current state of the
code: we require ALPN-negotiated transport headers on all direct connections.
2025-03-09 19:46:45 -04:00
Oliver Gould c87d202098
refactor(http): consolidate HTTP protocol detection (#3720)
Linkerd's HTTP protocol detection logic is spread across a few crates: the
linkerd-detect crate is generic over the actual protocol detection logic, and
the linkerd-proxy-http crate provides an implementation. There are no other
implemetations of the Detect interface. This leads to gnarly type signatures in
the form `Result<Option<http::Variant>, DetectTimeoutError>`: simultaneously
verbose and not particularly informative (what does the None case mean exactly).

This commit introduces a new crate, `linkerd-http-detect`, consolidating this
logic and removes the prior implementations. The admin, inbound, and outbound
stacks are updated to use these new types. This work is done in anticipation of
introducing metrics that report HTTP detection behavior.

There are no functional changes.
2025-03-09 08:27:25 -07:00
Oliver Gould 114ee8d878
fix(just): make dev versions semver (#3719)
Our build can occaisionally fail when the sha is not a valid semver label:

    --- stdout
    cargo:rustc-env=GIT_SHA=025979070
    cargo:rustc-env=LINKERD2_PROXY_BUILD_DATE=2025-03-08T16:32:34Z
    --- stderr
    thread 'main' panicked at linkerd/app/core/build.rs:18:17:
    LINKERD2_PROXY_VERSION must be semver: version='0.0.0-dev.025979070'
       error='invalid leading zero in pre-release identifier'

To fix this, the dot is removed so the version string is 0.0.0-dev025979070,
which is valid.
2025-03-08 18:30:06 -05:00
katelyn martin 4f24b84ee0
chore(deps): `tower` is a workspace dependency (#3718)
pr #3715 missed a small handful of cargo dependencies. this commit marks
these so that they also use the workspace-level tower version.

Signed-off-by: katelyn martin <kate@buoyant.io>
2025-03-08 10:17:51 -08:00
katelyn martin 09ecbd79b7
chore(deps): `drain` is a workspace dependency (#3717)
see https://github.com/linkerd/linkerd2/issues/8733 and
https://github.com/linkerd/linkerd2-proxy/pull/3504 for more
information.

see also linkerd/drain-rs#36 for a related pull request that
updated `drain`'s `tower` dependency. see #3715 (2f97549a) for a related
pull request that made `tower` a workspace dependency.

see #3456 (c740b6d8), #3466 (ca50d6bb), #3473 (b87455a9), and #3701
(cf4ef39), for some other previous pr's that moved dependencies to be
managed at the workspace level.

Signed-off-by: katelyn martin <kate@buoyant.io>
2025-03-07 16:34:24 -05:00
katelyn martin 4589be41ee
nit(detect): sort dependencies (#3716)
this is a follow-on to #3715.

this commit sorts the dependencies in this manifest.

Signed-off-by: katelyn martin <kate@buoyant.io>
2025-03-07 13:05:13 -08:00
katelyn martin 2f97549aed
chore(deps): `tower` crates are workspace dependencies (#3715)
* chore(deps): `tower` is a workspace dependency

see https://github.com/linkerd/linkerd2/issues/8733 for more
information.

see https://github.com/linkerd/linkerd2-proxy/pull/3504 as well.

see #3456 (c740b6d8), #3466 (ca50d6bb), #3473 (b87455a9), and #3701
(cf4ef39) for some other previous pr's that moved dependencies to be
managed at the workspace level.

see also https://github.com/linkerd/drain-rs/pull/36 for another related
pull request that relates to our tower dependency.

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(deps): `tower-service` is a workspace dependency

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(deps): `tower-test` is a workspace dependency

Signed-off-by: katelyn martin <kate@buoyant.io>

---------

Signed-off-by: katelyn martin <kate@buoyant.io>
2025-03-07 14:58:18 -05:00
katelyn martin d2111e59b9
chore(deps): update to ring 0.17.13 (#3713)
https://rustsec.org/advisories/RUSTSEC-2025-0009.html

0.17.11 is vulnerable to RUSTSEC-2025-0009. this commit updates the
`ring` dependency to a patched version.

Signed-off-by: katelyn martin <kate@buoyant.io>
2025-03-07 12:19:13 -05:00
dependabot[bot] 4a2bf8d876
build(deps): bump rustversion from 1.0.19 to 1.0.20 (#3712)
Bumps [rustversion](https://github.com/dtolnay/rustversion) from 1.0.19 to 1.0.20.
- [Release notes](https://github.com/dtolnay/rustversion/releases)
- [Commits](https://github.com/dtolnay/rustversion/compare/1.0.19...1.0.20)

---
updated-dependencies:
- dependency-name: rustversion
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-07 07:28:18 -08:00
dependabot[bot] bba79fd1dd
build(deps): bump either from 1.14.0 to 1.15.0 (#3711)
Bumps [either](https://github.com/rayon-rs/either) from 1.14.0 to 1.15.0.
- [Commits](https://github.com/rayon-rs/either/compare/1.14.0...1.15.0)

---
updated-dependencies:
- dependency-name: either
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-07 07:28:04 -08:00
dependabot[bot] c6c369c41f
build(deps): bump semver from 1.0.25 to 1.0.26 (#3710)
Bumps [semver](https://github.com/dtolnay/semver) from 1.0.25 to 1.0.26.
- [Commits](https://github.com/dtolnay/semver/compare/1.0.25...1.0.26)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-07 07:27:52 -08:00
dependabot[bot] a1d49e9ee8
build(deps): bump unicode-ident from 1.0.17 to 1.0.18 (#3709)
Bumps [unicode-ident](https://github.com/dtolnay/unicode-ident) from 1.0.17 to 1.0.18.
- [Commits](https://github.com/dtolnay/unicode-ident/compare/1.0.17...1.0.18)

---
updated-dependencies:
- dependency-name: unicode-ident
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-07 07:27:39 -08:00
katelyn martin 90e005a832
chore(deps): remove unused `opencensus`, `opentelemetry` dependencies (#3708)
noticed while addressing `cargo-deny` errors in #3504. these crates
include a few unused dependencies, which we can remove. while we
are in the neighborhood, we make some subjective tweaks to tidy up
these imports.

---

* chore(opentelemetry): remove unused `http` dependency

Signed-off-by: katelyn martin <kate@buoyant.io>

* nit(opentelemetry): tidy imports

this groups imports at the crate level, and directly imports some
imports from their respective crates rather than through an alias of
said crate. a `self` prefix is added to clarify imports from submodules
of this crate.

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(opentelemetry): remove unused `tokio-stream` dependency

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(opencensus): remove unused `http` dependency

Signed-off-by: katelyn martin <kate@buoyant.io>

* nit(opencensus): use self prefix in import

Signed-off-by: katelyn martin <kate@buoyant.io>

---------

Signed-off-by: katelyn martin <kate@buoyant.io>
2025-03-06 14:03:16 -08:00