Bulk Importing Metrics into OpenMetadata 1.9.1.0 via Python #22972
SodaFoundryDevon
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello community,
I am trying to import Metrics in bulk from a JSON file into OpenMetadata 1.9.1.0 using Python. My test code looked like this:
from metadata.ingestion.ometa.client import REST
from metadata.generated.schema.api.data.createMetric import CreateMetricRequest
Create REST client
metadata = REST(
endpoint="http://localhost:8585/api/v1",
auth_provider="no-auth"
)
Example metric
metric_request = CreateMetricRequest(
name="order_count",
displayName="Order Count",
description="Total number of orders per day",
metricType="NUMBER",
metricExpression="COUNT(order_id)"
)
metadata.create_or_update(metric_request)
I also tried using:
from metadata.ingestion.ometa.ometa_api import OpenMetadata
metadata = OpenMetadata(
config={
"api_endpoint": "http://localhost:8585/api/v1",
"auth_provider_type": "no-auth"
}
)
but this always resulted in:
AttributeError: 'dict' object has no attribute 'secretsManagerProvider'
I am looking for a stable approach to bulk upload metrics from JSON in Python for version 1.9.1.0.
My questions:
What is the correct way to import metrics in bulk into OpenMetadata 1.9.1.0 via Python?
Can this be done using the current openmetadata-ingestion SDK, or is there a recommended alternative for a “client-only” approach without using ingestion pipelines?
Are there any working examples of a REST client or Python client for uploading metrics in 1.9.1.0?
Any tips or example code would be greatly appreciated!
Thank you in advance 🙏
Beta Was this translation helpful? Give feedback.
All reactions