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

Improve ws-manager-bridge logging #8718

Merged
merged 3 commits into from
Mar 11, 2022
Merged

Improve ws-manager-bridge logging #8718

merged 3 commits into from
Mar 11, 2022

Conversation

easyCZ
Copy link
Member

@easyCZ easyCZ commented Mar 10, 2022

Description

  • Logs should be human readable sentence, hence starting with capital letters. This is also the golang standard practice so helps align across components.
  • Logging incoming messages and their payloads is probably the most useful out of all logging we can do in a request lifecycle - up the log level to info here.

Release Notes

ws-manager-bridge logs WorkspaceStatus events

Documentation

@@ -49,7 +49,11 @@ export class WsmanSubscriber implements Disposable {
const spanCtx = opentracing.globalTracer().extract(opentracing.FORMAT_HTTP_HEADERS, header);
const span = !!spanCtx ? opentracing.globalTracer().startSpan('incomingSubscriptionResponse', {references: [opentracing.childOf(spanCtx!)]}) : undefined;

callbacks.onStatusUpdate({ span }, status);
try {
Copy link
Member Author

Choose a reason for hiding this comment

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

Catching errors from the handler as it appears we do not catch these elsewhere and the exception would default serialise in the runtime.

@easyCZ easyCZ marked this pull request as ready for review March 10, 2022 14:43
@easyCZ easyCZ requested a review from a team March 10, 2022 14:43
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Mar 10, 2022
@codecov
Copy link

codecov bot commented Mar 10, 2022

Codecov Report

Merging #8718 (8a6491e) into main (bc1e9fa) will decrease coverage by 1.13%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8718      +/-   ##
==========================================
- Coverage   12.31%   11.17%   -1.14%     
==========================================
  Files          20       18       -2     
  Lines        1161      993     -168     
==========================================
- Hits          143      111      -32     
+ Misses       1014      880     -134     
+ Partials        4        2       -2     
Flag Coverage Δ
components-gitpod-cli-app 11.17% <ø> (ø)
components-local-app-app-darwin-amd64 ?
components-local-app-app-darwin-arm64 ?
components-local-app-app-linux-amd64 ?
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/local-app/pkg/auth/auth.go
components/local-app/pkg/auth/pkce.go

Continue to review full report at Codecov.

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

@geropl
Copy link
Member

geropl commented Mar 10, 2022

👍 for the additional logging and "info".

One thought wrt to the "upper- vs lowercase" thing: I know other contributors have different opinions on this topic, which led to some back and forth in the past. IMO we should have program to verify/correct this for us. Not sure if prettier/tslint can do this for us...?
If there's no mechanism to enforce this I personally would not invest energy there and leave it as-is. 👍

@easyCZ
Copy link
Member Author

easyCZ commented Mar 10, 2022

If there's no mechanism to enforce this I personally would not invest energy there and leave it as-is. 👍

Definitely possible, tho it may be best left to be done in the Go ecosystem as there's better support for this. An easy fix is to Uppercase the first letter in code :)

@roboquat roboquat merged commit d7ebf6b into main Mar 11, 2022
@roboquat roboquat deleted the mp/wsmgb-logs branch March 11, 2022 15:25
@jankeromnes
Copy link
Contributor

jankeromnes commented Mar 14, 2022

Gentle reminder: In future Pull Requests, please remember to squash your commits into logical units when the PR gets close to approval. 🙏

@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note size/M team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants