# Monitor dataset schema changes for compliance

Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdataprime%2Fcookbook%2Fmonitoring_dataset_changes.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdataprime%2Fcookbook%2Fmonitoring_dataset_changes.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

## Problem / Use case[​](#problem--use-case "Direct link to Problem / Use case")

You need to track datasets that undergo frequent schema updates. By focusing on `INFO`-level schema events and counting unique `snapshotId` values, this recipe helps highlight which datasets are changing most often — an important indicator for compliance and schema governance.

## Query[​](#query "Direct link to Query")

```
source system/engine.schema_fields

| filter $m.severity == INFO

| groupby dataset

    aggregate distinct_count(snapshotId) as schema_change_count

| sortby schema_change_count desc
```

## Expected output[​](#expected-output "Direct link to Expected output")

| dataset               | schema\_change\_count |
| --------------------- | --------------------- |
| aaa.audit\_events     | 10                    |
| engine.schema\_fields | 10                    |
| logs                  | 10                    |
| labs.limitViolations  | 10                    |
| spans                 | 10                    |
| engine.queries        | 6                     |

## Variations[​](#variations "Direct link to Variations")

* Filter for `ERROR`-level events to identify failed or invalid schema updates.
* Add `max($m.timestamp)` to include the most recent change time per dataset.
* Combine with `count()` to measure total schema events alongside distinct snapshots.

## TL;DR[​](#tldr "Direct link to TL;DR")

Count distinct schema snapshot IDs by dataset to surface frequently changing schemas — essential for monitoring data stability and compliance.
