Skip to content
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

feat(api): initialize metric tracking #239

Merged
merged 8 commits into from
Jan 11, 2024
Merged

feat(api): initialize metric tracking #239

merged 8 commits into from
Jan 11, 2024

Conversation

Lee-W
Copy link
Collaborator

@Lee-W Lee-W commented Dec 28, 2023

In this PR, we track "request id", "score", 'success" and "created_at" which can be used to calculate the number of traces (i.e. root runs = user requests) and another view will be created to group requst by success/failure, and the calculate Avg. correctness score, by day.

closes: #196

We do not have Snowflake access, and the Snowflake trial didn't work for me. Use SQLite as a POC. will change it to snowflake after we get the access

Copy link
Collaborator

@sunank200 sunank200 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lee-W could you update the PR description with all the metrics you are tracking, please?

I would suggest to add it in detail

Copy link

cloudflare-pages bot commented Jan 2, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: c880e02
Status: ✅  Deploy successful!
Preview URL: https://f9c33f8b.ask-astro.pages.dev
Branch Preview URL: https://track-metrics-in-db.ask-astro.pages.dev

View logs

@Lee-W Lee-W marked this pull request as ready for review January 5, 2024 10:32
@Lee-W
Copy link
Collaborator Author

Lee-W commented Jan 5, 2024

image image

Copy link
Collaborator

@sunank200 sunank200 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are there files like api.pickle, parquet files, csv files added as part of this PR?

api/ask_astro/config.py Outdated Show resolved Hide resolved
tasks/api.py Outdated Show resolved Hide resolved
tasks/api.py Outdated Show resolved Hide resolved
@Lee-W
Copy link
Collaborator Author

Lee-W commented Jan 9, 2024

Why are there files like api.pickle, parquet files, csv files added as part of this PR?

They're accidentally added. Removed them.

@Lee-W Lee-W requested a review from sunank200 January 9, 2024 08:02
Copy link
Collaborator

@pankajastro pankajastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good to me. But some similar data get stored in Firestore so it feels like redundant data between Snowflake and Firestore. Also from the maintenance point of view if we use only one between Firestore and Snowflake that would be great.

@sunank200
Copy link
Collaborator

this looks good to me. But some similar data get stored in Firestore so it feels like redundant data between Snowflake and Firestore. Also from the maintenance point of view if we use only one between Firestore and Snowflake that would be great.

Thats right. But this is a request from Steven for data team

@Lee-W Lee-W force-pushed the track-metrics-in-db branch 2 times, most recently from d1a0780 to 6f14159 Compare January 10, 2024 10:23
@Lee-W
Copy link
Collaborator Author

Lee-W commented Jan 10, 2024

Just rewrite it as airflow DAG as informed


from airflow.decorators import dag, task

METRICS_SNOWFLAKE_DB_USER = os.environ.get("METRICS_SNOWFLAKE_DB_USER")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not get these from the snowflake connection of airflow instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but I'm not sure whether we want. We'll need to install the provider simply to get the conn.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I am okay with current implementation for now but we could track this in future PRs.

Copy link
Collaborator

@sunank200 sunank200 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Let's make sure to add a section in this doc for this here before we merge this PR.

@Lee-W
Copy link
Collaborator Author

Lee-W commented Jan 11, 2024

Just update the documentation. Will merge this PR now

@Lee-W Lee-W merged commit 85f7239 into main Jan 11, 2024
7 checks passed
@Lee-W Lee-W deleted the track-metrics-in-db branch January 11, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Start more formal tracking of metrics (counts by success, tests, in Snowflake)
3 participants