122 points · by Maayansa · 4y ago · 30 comments
Elementary can alert you, for example, when a table in Snowflake hasn't been updated as expected or when a revenue column has too many nulls. It also monitors operations in the data stack, and provides for analyzing both impact and root cause. For example, it can alert you when your dbt runs or tests fail, including the impacted dependencies. A data lineage graph visualizes the data flow and can be used to find the source of invalid data.
We have both been working in the data space for over a decade, Maayan in analytics and Or in data engineering. Despite working at very different companies with different data stacks and use cases, we had the same reliability problems. Data is incomplete and inconsistent, and the abundance of technologies creates more complexity and inconsistency. Data reliability issues cause distrust, delays, and bad decisions. It's hard to achieve high data reliability, detect issues fast, understand impact and resolve quickly.
We also found that we had built similar solutions, and as we talked to other developers, we learned that most data teams have their own version of the same thing. They usually don’t go for a commercial observability solution unless they have major incidents and technical debt. Until that point, they prefer to build for themselves, for two reasons: to avoid the overhead of procurement and security compliance; and to customize to their own stack, data sources, business logic, etc, and have all the metadata and metrics in their stack to support additional use cases.
We decided to build an open-source alternative—one that can be implemented easily, hosted yourself, and customized. This solves the compliance and the data ownership problem. It also solves the build-your-own problem, because teams can deploy an extensive solution early on, instead of waiting till later when there are major problems.
Elementary stores all the logs, metadata, and metrics it collects and generates in the data warehouse, so users can easily add their own detections and logic to it. Additionally, the solution is dbt native, which means it provides a dbt package that can be easily installed in a dbt environment as well as configured directly from a dbt project. Since it's part of the existing workflow and environment, it makes it convenient for data engineers, analytics engineers, and data analysts to enhance and contribute.
Open source eliminates the need to pay for getting started or to grant access to a third party. A managed service and additional enterprise features will be available in the cloud in the future. Critically, though, the user's metadata will continue to reside in their environment, under their control, and they will still have full customization available.
Currently Elementary supports Snowflake, BigQuery and dbt. It collects metadata such as schemas, query logs and dbt artifacts. It generates and monitors data quality metrics, sends Slack alerts, and visualizes the data lineage. If this is your data stack, we’d love you to give it a try!
We would love to hear your feedback, experiences and ideas from trying to solve data observability in your organizations.
If you decide to copy not only ideas but a big part of internal implementation, I think you should include that information in your LICENSE.
Cheers
Looks like much of the lineage code is also largely a wrapper around this library: https://github.com/reata/sqllineage
Would be curious to understand the project's purpose and unique contributions vs. the underlying dependencies powering it as there seems to be some ambiguity. Is this just a wrapper around dbt transformations and a lineage library in one package? Can I just use them directly?
The lineage part is independent (re_data uses lineage from dbt), so I haven't looked into that much.
In terms of the lineage, you can see in the code that we mostly rely on query and access history that exist in Snowflake and Bigquery to parse the queries and learn about the connection between nodes in the graph. We use other python libraries like sqlfluff and sqllineage as low level parsers for some specific use cases which we extend and solve many things on top of them. Actually we're heavy open source users, depending on around 20 libraries, all MIT or Apache.
Elementary models like data_monitors_thread1, data_monitors_thread2, data_monitors_thread3, data_monitors_thread4, data_monitoring_metrics, latest_metrics, metrics_stats_for_anomalies, z_score, anomaly_detection, schema_schenages, etc. Existed before in re_data, are doing the same things and specifically for *_thread4 are not similar to anything you normally do in dbt.
And these similarities are also visible in code, for example here: the same usage of the undocumented dbt context feature.
# elementary
{% macro get_monitor_macro(monitor) %}
{%- set macro_name = monitor + '_monitor' -%}
{%- if context['elementary'].get(macro_name) -%}
{%- set monitor_macro = context['elementary'][macro_name] -%}
{%- else -%}
{%- set monitor_macro = context['elementary']['no_monitor'] -%}
{%- endif -%}
{{- return(monitor_macro) -}}
{% endmacro %}# re_data
{%- macro get_metric_macro(metric_name) %}
{% set macro_name = 're_data_metric' + '_' + metric_name %}
{% if context['re_data'].get(macro_name) %}
{% set metric_macro = context['re_data'][macro_name] %}
{%- else %}
{% set metric_macro = context[project_name][macro_name] %}
{% endif %}
{{ return (metric_macro) }}
{% endmacro %}And it's open-source so it's generally okay to do that, but it should be reflected in the LICENSE.
The guidelines say not to do it: https://news.ycombinator.com/newsguidelines.html, the FAQ says not to do it: https://news.ycombinator.com/newsfaq.html, and the Launch HN advice we give to YC startups says to "make sure" (in bold!) not to do it: https://news.ycombinator.com/yli.html. But people who aren't familiar with HN's conventions still end up doing it sometimes.
We make a distinction between innocent mistakes (which are usually obvious) and repeat offenses (where people usually try to cover their tracks). The former isn't a big deal, the latter we ban accounts for.