-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
chore(integrations): Add SLOs to finish_pipeline #94586
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #94586 +/- ##
==========================================
- Coverage 87.95% 87.94% -0.01%
==========================================
Files 10386 10393 +7
Lines 601771 602459 +688
Branches 23408 23408
==========================================
+ Hits 529258 529809 +551
- Misses 72057 72194 +137
Partials 456 456 |
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.
Bug: Permission Errors Masked as Success
Integration installation permission failures are incorrectly recorded as successful in SLO metrics. The finish_pipeline
method returns early on permission errors without calling lifecycle.record_failure()
or lifecycle.record_halt()
. As the IntegrationPipelineViewEvent
context manager defaults to assume_success=True
, these failures are logged as successes, skewing reliability metrics. This is inconsistent with how other errors (e.g., IntegrationError
) are handled.
src/sentry/integrations/pipeline.py#L139-L155
sentry/src/sentry/integrations/pipeline.py
Lines 139 to 155 in d85d837
if ( | |
org_context | |
and (not org_context.member or "org:integrations" not in org_context.member.scopes) | |
and not superuser_has_permission(self.request, ["org:integrations"]) | |
): | |
error_message = "You must be an organization owner, manager or admin to install this integration." | |
logger.info( | |
"build-integration.permission_error", | |
extra={ | |
"error_message": error_message, | |
"organization_id": self.organization.id if self.organization else None, | |
"user_id": self.request.user.id, | |
"provider_key": self.provider.key, | |
}, | |
) | |
return self.error(error_message) |
Bug: SLO Metrics Misreport Integration Failures
The IntegrationPipelineViewEvent
context manager incorrectly records IntegrationProviderError
cases as successful in SLO metrics. When an IntegrationProviderError
occurs, the finish_pipeline
method returns early via self.render_warning()
without calling lifecycle.record_failure()
or lifecycle.record_halt()
. This causes the context manager, which defaults to assume_success=True
, to log these errors as successes, skewing SLOs. This behavior is inconsistent with how IntegrationError
is handled, which correctly records failures.
src/sentry/integrations/pipeline.py#L169-L180
sentry/src/sentry/integrations/pipeline.py
Lines 169 to 180 in d85d837
return self.error(str(e)) | |
except IntegrationProviderError as e: | |
self.get_logger().info( | |
"build-integration.provider-error", | |
extra={ | |
"error_message": str(e), | |
"error_status": getattr(e, "code", None), | |
"organization_id": self.organization.id if self.organization else None, | |
"provider_key": self.provider.key, | |
}, | |
) | |
return self.render_warning(str(e)) |
Was this report helpful? Give feedback by reacting with 👍 or 👎
I dont think we have any SLOs for finish_pipeline despite being a major part of our integration installation pipeline