-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(ingestion/grafana): Add datasets and charts to dashboards with lineage and tags. Lineage back to source #12417
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
base: master
Are you sure you want to change the base?
feat(ingestion/grafana): Add datasets and charts to dashboards with lineage and tags. Lineage back to source #12417
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
metadata-ingestion/src/datahub/ingestion/source/grafana/models.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/grafana/field_utils.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/grafana/report.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/tests/unit/grafana/test_grafana_entity_mcp_builder.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/grafana/grafana_config.py
Show resolved
Hide resolved
Hi! Any update on this one? Really impatient to get this connector 👀 |
Bundle ReportChanges will increase total bundle size by 31.41kB (0.16%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: datahub-react-web-esmAssets Changed:
Files in
|
|
||
For optimal lineage extraction from SQL-based data sources: | ||
|
||
- Queries should be well-formed and complete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Well-formed" might be a bit ambiguous, could you clarify what kinds of queries are supported, and which ones aren’t?
service_account_token: "your_token" | ||
|
||
# Lineage extraction (default: true) | ||
extract_lineage: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In most of the sources, we usually call this config field: include_lineage
. It would be nice to keep consistent names across sources.
And that would be aligned with the one a couple of lines below: include_column_lineage
props[key] = str(value) | ||
|
||
if panel.targets: | ||
props["queryCount"] = str(len(panel.targets)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does queryCount
describe the value?
by checking this code, I would call it targetsCount
basic_mode: bool = Field( | ||
default=False, | ||
description="Enable basic extraction mode for users with limited permissions. " | ||
"In basic mode, only dashboard metadata is extracted without detailed panel information, " | ||
"lineage, or folder hierarchy. This requires only basic dashboard read permissions.", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the experience for a user running with limited permissions and basic_mode: False
?
Will the user get errors/warnings with the permissions errors or any suggestion to set basicMode: True
?
) | ||
|
||
# Lineage configuration | ||
extract_lineage: bool = Field( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as suggested before, I would call this include_lineage
default_factory=dict, | ||
description="Map of Grafana datasource types/UIDs to platform connection configs for lineage extraction", | ||
) | ||
stateful_ingestion: Optional[StatefulStaleMetadataRemovalConfig] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed considering the config already inherits from StatefulIngestionConfigBase
?
References: | ||
- Grafana HTTP API: https://grafana.com/docs/grafana/latest/developers/http_api/ | ||
- Dashboard API: https://grafana.com/docs/grafana/latest/developers/http_api/dashboard/ | ||
- Folder API: https://grafana.com/docs/grafana/latest/developers/http_api/folder/ | ||
- Search API: https://grafana.com/docs/grafana/latest/developers/http_api/other/#search-api | ||
- Dashboard JSON structure: https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/view-dashboard-json-model/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💟
targets: List[Dict[str, Any]] = Field(default_factory=list) | ||
datasource: Optional[Dict[str, Any]] = None | ||
field_config: Dict[str, Any] = Field(default_factory=dict, alias="fieldConfig") | ||
transformations: List[Dict[str, Any]] = Field(default_factory=list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are the keys in this dicts?
a comment may help, or a better naming: eg targets_by_id
, targets_by_name
...
also, can we narrow down the value types rather than just Any
?
Co-authored-by: Sergio Gómez Villamor <[email protected]>
Adding functionality to the existing Grafana connector. The existing connector supports Dashboard identification only Changed implement the following:
Checklist