# Privacy and Security

## End-to-End Data Flow with PII Handling

slaOS does not perform any hashing or transformation of identifiers - it works with the data exactly as it exists in your Prometheus metrics. If you have privacy concerns about sensitive data, you'll need to handle the hashing in your systems before the data reaches Prometheus.

{% content-ref url="/pages/Sfc56UyaMrSY8RetDf5a" %}
[Data hashing & transformation](/onboarding-your-data/filters/data-hashing-and-transformation.md)
{% endcontent-ref %}

Here's how the data flows:

1. **Metrics in Prometheus**

```yaml
# Prometheus metrics (with sensitive data)
api_requests_total{
    customer_id="super_secret_user",  # Sensitive data
    endpoint="/api/v1/users"
} 150
```

2. **PromQL Query Configuration**

```yaml
queries:
  - query: 'sum by (customer_id, endpoint) (rate(api_requests_total[5m]))'
    step: 
      value: 60
      unit: "s"
    slaos_metric_name: "request_rate"
    organization_identifier: "customer_id"
    
# In filters config:
filters:
  version: 1
  fields:
    - name: "customer_id"  # This tells the parser to reference customer_id label
      hash: true           # Hashes customer_id labels

```

3. **Resulting slaOS JSON Payload**

```json
{
  "organization_id": "hashedabc123...",  # Hashed value sent
  "timestamp": "2024-10-30T23:29:00Z",
  "key": "prometheus_metrics",
  "idempotency_key": "4ac1f5c3524c05b379d3a23932756e0f156f17638b528559e62bb06dd4efbe6b",
  "values": {
    "request_rate": 0.5,
    "endpoint": "/api/v1/users"
  }
}
```

## Key Points

* slaOS passes through identifiers exactly as they appear in Prometheus
* No hashing or transformation is performed by slaOS
* If you need to protect sensitive data, handle the hashing in your systems before it reaches Prometheus
* You are responsible for maintaining any mapping between original and hashed identifiers in your secure systems


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rated.co/onboarding-your-data/integrations/prometheus/privacy-and-security.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
