Skip to content
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

feat: demote retry message, dump vapid claims. #510

Merged
merged 5 commits into from
Nov 13, 2023

Conversation

jrconlin
Copy link
Member

@jrconlin jrconlin commented Nov 6, 2023

This patch demotes the retryable error! message since it's not actionable.

It also introduces a dump of the VAPID claims, extracting the sub from the header for easy parsing.

Closes: SYNC-3996

This patch demotes the `retryable` `error!` message since it's not
actionable.

It also introduces a dump of the `VAPID` claims, extracting the `sub`
from the header for easy parsing.
@jrconlin jrconlin requested a review from pjenvey November 6, 2023 19:25
Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
autoendpoint/src/extractors/subscription.rs Show resolved Hide resolved
autoendpoint/src/extractors/subscription.rs Outdated Show resolved Hide resolved
let claims = vapid.token.split('.').collect::<Vec<&str>>();
if let Some(claims_str) = claims.get(1) {
use base64::Engine;
info!(
Copy link
Member

Choose a reason for hiding this comment

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

What's the goal of this one? This won't emit to the logs currently if that was the intention because autoendpoint only logs at the warn level.

I know we've talked about emitting more such data in the future but I'm not sure exactly what and where to emit it yet -- as is this seems like it would too chatty (if it were a warn!).

Copy link
Member Author

Choose a reason for hiding this comment

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

Huh. Doing a BigQuery search on ...autopush_prod_log.stdout shows that we're capturing log messages with INFO severity, (jsonPayload.severity = 6.0) for the Session info. I presume I'm looking at the wrong ones?

Copy link
Member Author

Choose a reason for hiding this comment

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

As for the goal of this, I view it as the same sort of data we collect for the session info. We'd dump it to stdout and query it using Bigquery.

Copy link
Member

Choose a reason for hiding this comment

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

autoconnect is set to info so you may only be seeing those (or maybe our severity is not trustworthy?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps, but I got those values from the Google docs

That said, the values we're seeing in the GCP logs do not appear to be the same ones we're generating here (The ones in the logs appear to be floats, these are integers), so maybe the docs are wrong and some experimentation is in order.

Copy link
Member

@pjenvey pjenvey Nov 9, 2023

Choose a reason for hiding this comment

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

But per the metric emitted a little later in this method we've had about 2k vapid notifications per second emitted around the time that I wrote this which isn't even peak.

We can merge this as is since it won't output to logs yet, but it probably makes more sense as a debug! for now (especially since that will remove the log call entirely at compile time w/ release_max_level_info).

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair. I'll demote to debug as well for this, just to keep things safer.

Copy link
Member Author

Choose a reason for hiding this comment

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

Meh, if we're not using this, throw it behind a feature flag.

autoendpoint/src/extractors/subscription.rs Show resolved Hide resolved
@jrconlin jrconlin merged commit cc4048c into master Nov 13, 2023
1 check passed
@jrconlin jrconlin deleted the feat/sync-3996_logging branch November 13, 2023 17:32
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.

2 participants