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: set telemetry events #1421

Merged
merged 9 commits into from
Apr 8, 2022
Merged

feat: set telemetry events #1421

merged 9 commits into from
Apr 8, 2022

Conversation

ssoroka
Copy link
Contributor

@ssoroka ssoroka commented Mar 31, 2022

Summary

Checklist

  • Wrote appropriate unit tests
  • Considered security implications of the change
  • Updated associated docs where necessary
  • Updated associated configuration where necessary
  • Change is backwards compatible if it needs to be (user can upgrade without manual steps?)
  • Nothing sensitive logged
  • Commit message conforms to Conventional Commit
  • GitHub Actions are passing
  • Considered data migrations for smooth upgrades

Related Issues

Resolves #1285

internal/server/handlers.go Outdated Show resolved Hide resolved
@@ -66,6 +66,8 @@ func sendAPIError(c *gin.Context, err error) {
logging.WrappedSugarLogger(c).Errorw(err.Error(), "statusCode", resp.Code)
}

a.t.Event(c, "error", Properties{"code": resp.Code})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would this have context of what errored?

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1, maybe just the endpoint

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure we need this for telemetry, since it will error for every single (expected) error as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changing this to only record for status code >= 500

@@ -66,6 +66,8 @@ func sendAPIError(c *gin.Context, err error) {
logging.WrappedSugarLogger(c).Errorw(err.Error(), "statusCode", resp.Code)
}

a.t.Event(c, "error", Properties{"code": resp.Code})
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1, maybe just the endpoint

internal/server/telemetry.go Show resolved Hide resolved
internal/server/telemetry.go Outdated Show resolved Hide resolved
if err != nil {
return err
switch track := track.(type) {
case analytics.Track:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can do an if statement here and get rid of the duplication

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can't. it's a reflection thing where track assumes the type of the case

@ssoroka ssoroka merged commit 264cf85 into main Apr 8, 2022
@ssoroka ssoroka deleted the telemetry branch April 8, 2022 19:59
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.

Audit telemetry for launch
4 participants