question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use second project in the same application?

See original GitHub issue

Environment

How do you use Sentry? Sentry SaaS (sentry.io)

Which SDK and version? python2, sentry-sdk 1.5.4

Problem: there is sentry-integration in an application, I need to send events to another project without breaking main integration, so I’m trying to create local client + scope + hub, but it has problems - an event not always displayed and tags can be wrong.

Steps to Reproduce

    scope = sentry_sdk.Scope()
    scope.set_tag('hostname', 'local.host.se')
    scope.set_tag('key', 'value')

    client = sentry_sdk.Client("https://99ae@o.ingest.sentry.io/123", release='8.5')
    
    hub = sentry_sdk.Hub(client, scope)
    hub.capture_event(dict(
        message='test11',
        level='error'
    ))

Expected Result

event is appeared on page ‘issues’

Actual Result

event not always added, and if it’s added it can contains wrong tags

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lega911commented, Feb 3, 2022

@sl0thentr0py thank you for help

0reactions
sl0thentr0pycommented, Feb 3, 2022

The correct usage in that case is

print('global', id(sentry_sdk.Hub.current), sentry_sdk.Hub.current)

hub = sentry_sdk.Hub(client)
print('local', id(hub), hub)

with hub:
  hub.capture_event(...)

all events to the same issue

for a separate issue, please make another issue or contact support. Github issues are generally for feature requests/bug reports, we entertain questions once in a while but please keep them in scope.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to: Set multiple startup projects - Visual Studio (Windows)
To set multiple startup projects · In Solution Explorer, select the solution (the top node). · Choose the solution node's context (right-click) ...
Read more >
Running two project at a time in Visual Studio 2019
Open Visual Studio and go to Solution Explorer. ... By default single project is set as startup project. ... Select multiple project option...
Read more >
c# - Run a second project from within the same solution
You can use Process.Start to run the AutoUpdater exe by providing the path.
Read more >
Can not run two project within the same solution
Create a solution which contain two C# Console app(or two .et framework web form apps) · Open the same solution in two instances...
Read more >
[Solved] using two projects in one solution - CodeProject
Do you mean 2 project in 1 solution? Or referring a nesting of project. If you have 2 project in 1 solution then,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found