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: add logfire as output method #542

Merged
merged 15 commits into from
Jun 17, 2024
Merged

feat: add logfire as output method #542

merged 15 commits into from
Jun 17, 2024

Conversation

inimaz
Copy link
Contributor

@inimaz inimaz commented May 4, 2024

Goal

Open the discussion on how codecarbon could send the output to logfire, a new monitoring framework https://docs.pydantic.dev/logfire/

How to use this branch

pip install logfire
logfire auth

This redirects to a page where you can log in with your github user.

Once your logfire account is created, run the script:

hatch run python examples/logfire_metrics.py'

Output

Example of the output that I obtain
image

@inimaz inimaz requested a review from SaboniAmine May 4, 2024 17:24
@inimaz
Copy link
Contributor Author

inimaz commented May 4, 2024

As discussed @SabAmine, here it is a rough example using the log output. What do you think?

@inimaz inimaz changed the title example: usage of codecarbon with logfire Draft example: usage of codecarbon with logfire May 5, 2024
@inimaz inimaz marked this pull request as draft May 14, 2024 10:47
inimaz and others added 5 commits May 21, 2024 17:34
Signed-off-by: inimaz <93inigo93@gmail.com>
Signed-off-by: inimaz <93inigo93@gmail.com>
Signed-off-by: inimaz <93inigo93@gmail.com>
@inimaz inimaz changed the title Draft example: usage of codecarbon with logfire feat: use logfire as output method May 26, 2024
@inimaz inimaz marked this pull request as ready for review May 26, 2024 16:51
@inimaz inimaz changed the title feat: use logfire as output method feat: add logfire as output method May 26, 2024
@inimaz
Copy link
Contributor Author

inimaz commented May 26, 2024

Example of a chart on logfire using the codecarbon data
image

@inimaz
Copy link
Contributor Author

inimaz commented May 26, 2024

Same example with emissions chart in g
image

@inimaz
Copy link
Contributor Author

inimaz commented Jun 16, 2024

@SaboniAmine It should be ready to merge. Now it uses the composite output handling coming from master. And it calls logfire.configure() to setup the main instance of logfire (see last commit).

Copy link
Collaborator

@SaboniAmine SaboniAmine left a comment

Choose a reason for hiding this comment

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

Just a small but maybe impactful question.

codecarbon/output_methods/http.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@SaboniAmine SaboniAmine left a comment

Choose a reason for hiding this comment

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

Thanks for the work!

@inimaz inimaz merged commit f8268ce into master Jun 17, 2024
8 checks passed
@inimaz inimaz deleted the feat/logfire-test branch June 17, 2024 20:00
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.

None yet

2 participants