def prometheus_sla_enricher(event: ExecutionBaseEvent, params: PrometheusSlaParams):
    """
    Enriches the finding title and description with an SLA VIOATLION warning incase a condition is met.
    """

    if not params.promql_query:
        raise Exception("Invalid request, prometheus_enricher requires a promql query.")

    if params.operator not in [">", "<", "==", "!="]:
        params.operator = ">"

    try:
        prometheus_result = run_prometheus_query(prometheus_params=params, query=params.promql_query)
    except PrometheusApiClientException as e:
        data = PrometheusQueryResult({"resultType": "error", "result": str(e)})
        event.add_enrichment(
            [PrometheusBlock(data=data, query=params.promql_query)],
        )
        return

    query_result = 0
    if prometheus_result.result_type == "scalar":
        query_result = prometheus_result.scalar_result["value"]
    elif prometheus_result.result_type == "vector":
        query_result = float(prometheus_result.vector_result[-1]["value"]["value"])

    rule_result: bool = False
    if params.operator == ">":
        rule_result = query_result > params.threshold
    elif params.operator == "<":
        rule_result = query_result < params.threshold
    elif params.operator == "==":
        rule_result = query_result == params.threshold
    elif params.operator == "!=":
        rule_result = query_result != params.threshold

    original_title = ""
    for sink in event.named_sinks:
        for finding in event.sink_findings[sink]:
            original_title = finding.title
        break

    event.add_enrichment(
        [MarkdownBlock("*SLA Query* : " + params.promql_query)],
    )

    operator_to_name = {"<": "lt", "==": "eq", ">": "gt", "!=": "ne"}
    sla_violation = "SLA VIOLATION" if rule_result else "SLA"
    new_title = f"{sla_violation} {query_result:.3f} {operator_to_name.get(params.operator)} {params.threshold} {original_title}"
    event.override_finding_attributes(title=new_title)

    Enriches the finding title and description with an SLA VIOATLION warning incase a condition is met.
    
playbooks/robusta_playbooks/prometheus_enrichments.py