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

[Uptime] Alerting - Copy Uptime alert state to context #128760

Closed
dominiqueclarke opened this issue Mar 29, 2022 · 2 comments · Fixed by #128693
Closed

[Uptime] Alerting - Copy Uptime alert state to context #128760

dominiqueclarke opened this issue Mar 29, 2022 · 2 comments · Fixed by #128693
Labels
enhancement New value added to drive a business result Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability

Comments

@dominiqueclarke
Copy link
Contributor

Relates to: #126280

Uptime alerts currently prefer state over context. Many helpful variables for users to craft alert connectors are managed on state, rather than context.

State variables are serialized and persisted in the task manager document. They are primarily intended to persist data across one alert execution to another. However, Uptime does not actually use any of the values in state across alert executions. If we do not need to have access to this data across executions, we should prefer context.

In addition, alerting will now offer rules the ability to specify context variables for recovered alerts, but does not plan to offer the ability to specify state variables for recovered alerts. Moving to context variables where possible will make it easier for us to specify variables in recovered alert messages.

To preserve backward compatibility, Uptime should copy over state variables to context and prefer context in default alert messages.

@dominiqueclarke dominiqueclarke added enhancement New value added to drive a business result Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability labels Mar 29, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@awahab07
Copy link
Contributor

awahab07 commented Jun 8, 2022

Post FF Testing

  • context variables are substituted correctly for both Monitor status and TLS alerts.
  • state variables work as expected for both Monitor status and TLS alerts.
Rule Type Template Message
Monitor status Monitor {{context.monitorName}} with url {{{context.monitorUrl}}} from {{context.observerLocation}} {{{context.statusMessage}}} The latest error message is {{{context.latestErrorMessage}}} Monitor Fleet_Server_Health_ext with url https://fleet.34.132.15.251.ip.es.io/api/status from Unnamed-location failed 271 times in the last 15 mins. Alert when > 5. The 30 days availability is 0.00%. Alert when < 99%. The latest error message is received status code 404 expecting [200];;
Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} from {{state.observerLocation}} {{{state.statusMessage}}} The latest error message is {{{state.latestErrorMessage}}} Monitor Fleet_Server_Health_ext with url https://fleet.34.132.15.251.ip.es.io/api/status from Unnamed-location failed 271 times in the last 15 mins. Alert when > 5. The 30 days availability is 0.00%. Alert when < 99%. The latest error message is received status code 404 expecting [200]
TLS Detected TLS certificate {{context.commonName}} from issuer {{context.issuer}} is {{context.status}}. Certificate {{context.summary}} Detected TLS certificate fleet.34.132.15.251.ip.es.io from issuer R3 is expiring. Certificate expires on Jul 8, 2022 in 29 days.;;
Detected TLS certificate {{state.commonName}} from issuer {{state.issuer}} is {{state.status}}. Certificate {{state.summary}} Detected TLS certificate fleet.34.132.15.251.ip.es.io from issuer R3 is expiring. Certificate expires on Jul 8, 2022 in 29 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants