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: add telemetry for the cluster status endpoint #3610

Merged
merged 2 commits into from
Sep 20, 2023

Conversation

jose-fully-ported
Copy link
Contributor

What does this PR do?

This PR adds some telemetry to the cluster status endpoint. The endpoint currently just returns an internal service error without any extra context. Without this change, internal service errors get swallowed up, making debugging more difficult.

api/server/handlers/cluster/cluster_status.go Outdated Show resolved Hide resolved
c.HandleAPIError(w, r, apierrors.NewErrInternal(e))
err := fmt.Errorf("unable to retrieve status for cluster: %w", err)
err = telemetry.Error(ctx, span, err, err.Error())
c.HandleAPIError(w, r, apierrors.NewErrInternal(err))

Choose a reason for hiding this comment

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

why not pass through the err?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just didn't want to change the response here.

@jose-fully-ported jose-fully-ported force-pushed the jose-fully-ported/status-telemetry branch from 62e95fd to dc73a84 Compare September 20, 2023 16:23
@jose-fully-ported jose-fully-ported force-pushed the jose-fully-ported/status-telemetry branch from dc73a84 to 269a704 Compare September 20, 2023 17:10
@jose-fully-ported jose-fully-ported enabled auto-merge (squash) September 20, 2023 17:14
@jose-fully-ported jose-fully-ported force-pushed the jose-fully-ported/status-telemetry branch from 269a704 to 337f1da Compare September 20, 2023 17:15
@jose-fully-ported jose-fully-ported merged commit 078792c into master Sep 20, 2023
8 checks passed
@jose-fully-ported jose-fully-ported deleted the jose-fully-ported/status-telemetry branch September 20, 2023 17:24
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