-
Notifications
You must be signed in to change notification settings - Fork 273
metrics: add process_uptime_seconds_total
metric
#1659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
olix0r
approved these changes
May 10, 2022
linkerd/tracing/src/lib.rs
Outdated
Comment on lines
63
to
65
pub fn from_env() -> Self { | ||
Self { | ||
filter: std::env::var(ENV_LOG_LEVEL).ok(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC this is only called in one place. Should it just take an Instant
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call, changed it to just pass in the Instant
there!
Signed-off-by: Eliza Weisman <[email protected]>
olix0r
added a commit
to linkerd/linkerd2
that referenced
this pull request
May 12, 2022
This release updates "ingress-mode" proxies to be able to forward non-HTTP traffic within the cluster. Protocol detection is always attempted for outbound connections, however, when in ingress mode. This release also adds a new `process_uptime_seconds_total` metric. --- * Replace std::<num>::MAX with <num>::MAX (linkerd/linkerd2-proxy#1619) * build(deps): bump prettyplease from 0.1.9 to 0.1.10 (linkerd/linkerd2-proxy#1624) * build(deps): bump tj-actions/changed-files from 18.7 to 19 (linkerd/linkerd2-proxy#1628) * build(deps): bump httparse from 1.7.0 to 1.7.1 (linkerd/linkerd2-proxy#1627) * build(deps): bump tonic-build from 0.7.0 to 0.7.1 (linkerd/linkerd2-proxy#1629) * build(deps): bump pin-project-lite from 0.2.8 to 0.2.9 (linkerd/linkerd2-proxy#1630) * build(deps): bump codecov/codecov-action from 3.0.0 to 3.1.0 (linkerd/linkerd2-proxy#1620) * build(deps): bump actions/checkout from 3.0.1 to 3.0.2 (linkerd/linkerd2-proxy#1621) * build(deps): bump anyhow from 1.0.56 to 1.0.57 (linkerd/linkerd2-proxy#1623) * build(deps): bump tracing-log from 0.1.2 to 0.1.3 (linkerd/linkerd2-proxy#1622) * build(deps): bump tinyvec from 1.5.1 to 1.6.0 (linkerd/linkerd2-proxy#1625) * build(deps): bump unicode-bidi from 0.3.7 to 0.3.8 (linkerd/linkerd2-proxy#1626) * build(deps): bump libc from 0.2.124 to 0.2.125 (linkerd/linkerd2-proxy#1632) * build(deps): bump tokio from 1.17.0 to 1.18.0 (linkerd/linkerd2-proxy#1633) * build(deps): bump syn from 1.0.91 to 1.0.92 (linkerd/linkerd2-proxy#1634) * build(deps): bump http from 0.2.6 to 0.2.7 (linkerd/linkerd2-proxy#1631) * build(deps): bump serde from 1.0.136 to 1.0.137 (linkerd/linkerd2-proxy#1639) * build(deps): bump serde_json from 1.0.79 to 1.0.80 (linkerd/linkerd2-proxy#1635) * build(deps): bump thiserror from 1.0.30 to 1.0.31 (linkerd/linkerd2-proxy#1636) * build(deps): bump parking_lot_core from 0.9.2 to 0.9.3 (linkerd/linkerd2-proxy#1637) * build(deps): bump memchr from 2.4.1 to 2.5.0 (linkerd/linkerd2-proxy#1638) * build(deps): bump tokio from 1.18.0 to 1.18.1 (linkerd/linkerd2-proxy#1643) * build(deps): bump unicode-xid from 0.2.2 to 0.2.3 (linkerd/linkerd2-proxy#1646) * build(deps): bump log from 0.4.16 to 0.4.17 (linkerd/linkerd2-proxy#1645) * build(deps): bump num-traits from 0.2.14 to 0.2.15 (linkerd/linkerd2-proxy#1644) * ingress: Fall back to normal TCP forwarding (linkerd/linkerd2-proxy#1649) * build(deps): bump serde_json from 1.0.80 to 1.0.81 (linkerd/linkerd2-proxy#1647) * build(deps): bump tokio-rustls from 0.23.3 to 0.23.4 (linkerd/linkerd2-proxy#1648) * build(deps): bump tonic-build from 0.7.1 to 0.7.2 (linkerd/linkerd2-proxy#1650) * build(deps): bump prost-build from 0.10.0 to 0.10.3 (linkerd/linkerd2-proxy#1651) * build(deps): bump socket2 from 0.4.4 to 0.4.5 (linkerd/linkerd2-proxy#1654) * build(deps): bump EmbarkStudios/cargo-deny-action from 1.2.15 to 1.2.16 (linkerd/linkerd2-proxy#1653) * build(deps): bump prost from 0.10.0 to 0.10.3 (linkerd/linkerd2-proxy#1655) * build(deps): bump tokio from 1.18.1 to 1.18.2 (linkerd/linkerd2-proxy#1657) * build(deps): bump mio from 0.8.2 to 0.8.3 (linkerd/linkerd2-proxy#1656) * build(deps): bump proc-macro2 from 1.0.37 to 1.0.38 (linkerd/linkerd2-proxy#1658) * build(deps): bump EmbarkStudios/cargo-deny-action from 1.2.16 to 1.2.17 (linkerd/linkerd2-proxy#1660) * build(deps): bump syn from 1.0.92 to 1.0.93 (linkerd/linkerd2-proxy#1661) * metrics: add `process_uptime_seconds_total` metric (linkerd/linkerd2-proxy#1659) Signed-off-by: Oliver Gould <[email protected]>
mateiidavid
pushed a commit
to linkerd/linkerd2
that referenced
this pull request
May 13, 2022
This release updates "ingress-mode" proxies to be able to forward non-HTTP traffic within the cluster. Protocol detection is always attempted for outbound connections, however, when in ingress mode. This release also adds a new `process_uptime_seconds_total` metric. --- * Replace std::<num>::MAX with <num>::MAX (linkerd/linkerd2-proxy#1619) * build(deps): bump prettyplease from 0.1.9 to 0.1.10 (linkerd/linkerd2-proxy#1624) * build(deps): bump tj-actions/changed-files from 18.7 to 19 (linkerd/linkerd2-proxy#1628) * build(deps): bump httparse from 1.7.0 to 1.7.1 (linkerd/linkerd2-proxy#1627) * build(deps): bump tonic-build from 0.7.0 to 0.7.1 (linkerd/linkerd2-proxy#1629) * build(deps): bump pin-project-lite from 0.2.8 to 0.2.9 (linkerd/linkerd2-proxy#1630) * build(deps): bump codecov/codecov-action from 3.0.0 to 3.1.0 (linkerd/linkerd2-proxy#1620) * build(deps): bump actions/checkout from 3.0.1 to 3.0.2 (linkerd/linkerd2-proxy#1621) * build(deps): bump anyhow from 1.0.56 to 1.0.57 (linkerd/linkerd2-proxy#1623) * build(deps): bump tracing-log from 0.1.2 to 0.1.3 (linkerd/linkerd2-proxy#1622) * build(deps): bump tinyvec from 1.5.1 to 1.6.0 (linkerd/linkerd2-proxy#1625) * build(deps): bump unicode-bidi from 0.3.7 to 0.3.8 (linkerd/linkerd2-proxy#1626) * build(deps): bump libc from 0.2.124 to 0.2.125 (linkerd/linkerd2-proxy#1632) * build(deps): bump tokio from 1.17.0 to 1.18.0 (linkerd/linkerd2-proxy#1633) * build(deps): bump syn from 1.0.91 to 1.0.92 (linkerd/linkerd2-proxy#1634) * build(deps): bump http from 0.2.6 to 0.2.7 (linkerd/linkerd2-proxy#1631) * build(deps): bump serde from 1.0.136 to 1.0.137 (linkerd/linkerd2-proxy#1639) * build(deps): bump serde_json from 1.0.79 to 1.0.80 (linkerd/linkerd2-proxy#1635) * build(deps): bump thiserror from 1.0.30 to 1.0.31 (linkerd/linkerd2-proxy#1636) * build(deps): bump parking_lot_core from 0.9.2 to 0.9.3 (linkerd/linkerd2-proxy#1637) * build(deps): bump memchr from 2.4.1 to 2.5.0 (linkerd/linkerd2-proxy#1638) * build(deps): bump tokio from 1.18.0 to 1.18.1 (linkerd/linkerd2-proxy#1643) * build(deps): bump unicode-xid from 0.2.2 to 0.2.3 (linkerd/linkerd2-proxy#1646) * build(deps): bump log from 0.4.16 to 0.4.17 (linkerd/linkerd2-proxy#1645) * build(deps): bump num-traits from 0.2.14 to 0.2.15 (linkerd/linkerd2-proxy#1644) * ingress: Fall back to normal TCP forwarding (linkerd/linkerd2-proxy#1649) * build(deps): bump serde_json from 1.0.80 to 1.0.81 (linkerd/linkerd2-proxy#1647) * build(deps): bump tokio-rustls from 0.23.3 to 0.23.4 (linkerd/linkerd2-proxy#1648) * build(deps): bump tonic-build from 0.7.1 to 0.7.2 (linkerd/linkerd2-proxy#1650) * build(deps): bump prost-build from 0.10.0 to 0.10.3 (linkerd/linkerd2-proxy#1651) * build(deps): bump socket2 from 0.4.4 to 0.4.5 (linkerd/linkerd2-proxy#1654) * build(deps): bump EmbarkStudios/cargo-deny-action from 1.2.15 to 1.2.16 (linkerd/linkerd2-proxy#1653) * build(deps): bump prost from 0.10.0 to 0.10.3 (linkerd/linkerd2-proxy#1655) * build(deps): bump tokio from 1.18.1 to 1.18.2 (linkerd/linkerd2-proxy#1657) * build(deps): bump mio from 0.8.2 to 0.8.3 (linkerd/linkerd2-proxy#1656) * build(deps): bump proc-macro2 from 1.0.37 to 1.0.38 (linkerd/linkerd2-proxy#1658) * build(deps): bump EmbarkStudios/cargo-deny-action from 1.2.16 to 1.2.17 (linkerd/linkerd2-proxy#1660) * build(deps): bump syn from 1.0.92 to 1.0.93 (linkerd/linkerd2-proxy#1661) * metrics: add `process_uptime_seconds_total` metric (linkerd/linkerd2-proxy#1659) 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The proxy exposes a
process_cpu_seconds_total
metric. It also exposesa
process_start_time_seconds
metric. But given a random metricssnapshot, we have no way of knowing the proxy's uptime unless we know
the current time at the time of the snapshot. linkerd/linkerd2#8443
proposed adding a
process_uptime_seconds_total
metric tracking the(fractional) number of seconds since the process started, to make these
other process metrics easier to interpret.
This branch implements the
process_uptime_seconds_total
metric.Actually adding the metric is rather simple.
However, it occurred to me that uptimes are also used as timestamps in
the proxy's
tracing
logs. Currently, the start time used to calculatelog timestamps is just recorded when constructing the logger. If
separate
Instant
s are used as the start time for log uptime timestampsand for the
process_uptime_seconds_total
metric, this means theprocess' uptime as reported by the metrics endpoint and the process'
uptime according to log messages may not quite agree. Therefore, I
thought it would be good if a single
Instant
was used for both loggingand metrics, and I made some additional changes so that we can record a
single timestamp when the proxy starts, and pass it into both the
metrics endpoint and the logger. This does make this branch a slightly
larger change, though.
Closes linkerd/linkerd2#8443