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(devservices): Add sentry to devservices #17

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--index-url https://pypi.devinfra.sentry.io/simple
pyyaml==6.0.1
sentry-devenv==1.8.0
sentry-devenv==1.8.0
sentry-sdk==2.14.0
14 changes: 13 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@

import argparse

import sentry_sdk
from commands import list_dependencies
from commands import list_services
from commands import logs
from commands import start
from commands import status
from commands import stop
from sentry_sdk.integrations.argv import ArgvIntegration


sentry_sdk.init(
dsn="https://[email protected]/4507946704961536",
traces_sample_rate=1.0,
profiles_sample_rate=1.0,
enable_tracing=True,
integrations=[ArgvIntegration()],
)


def main() -> None:
Expand All @@ -30,7 +41,8 @@ def main() -> None:

if args.command:
# Call the appropriate function based on the command
args.func(args)
with sentry_sdk.start_transaction(op="command", name=args.command):
args.func(args)
else:
parser.print_help()

Expand Down