-
Notifications
You must be signed in to change notification settings - Fork 0
Add basic Sentry tracing instrumentation #4
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
base: master
Are you sure you want to change the base?
Conversation
src/sentry.tsx
Outdated
} | ||
const transaction = (tracingIntegration as any).constructor.getTransaction(); | ||
if (!transaction) { | ||
console.warn("startSpan called without transaction"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesnt need to be a warning as its super common..
i also likely need to add new styles of transactions here. not sure what yet, but maybe when someone presses a tile its a new transaction. will experiment and see what can create value for patterns.
src/hass.tsx
Outdated
setTimeout(() => { | ||
this._pendingChanges.delete(payload.id); | ||
}, 1000); | ||
resolve(payload); | ||
} else if (payload.error) { | ||
if (span) { | ||
span.setStatus(SpanStatus.UnknownError); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
understanding how to map other systems status codes to our status codes will be a challenge for folks.. going to try an exercise of doing this w/ hass
43f1159
to
c2d6c66
Compare
console.warn("startSpan called without tracing integration"); | ||
return null; | ||
} | ||
const transaction = (tracingIntegration as any).constructor.getTransaction(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its not ideal that we have to attach a span to a transaction (aka we cant always return a span)
c2d6c66
to
d3d83a6
Compare
return transaction.startChild(options); | ||
}; | ||
|
||
export const startTransaction = (options: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesnt actually seem to work well.. to some degree i wanted to manually bind a transaction but the tracing integration couples them to itself, and theres no real APIs afaik to manage them without the idle helper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you just use Sentry.startTransaction
https://github.com/EvanPurkhiser/prolink-connect/blob/master/src/network.ts#L102
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
damn - didnt find that one :(
d3d83a6
to
8ece59c
Compare
@@ -141,6 +143,34 @@ export default class Tile< | |||
} | |||
}; | |||
|
|||
handleOnTouch = async () => { | |||
if (!this.onTouch) return; | |||
Sentry.withScope(async (scope) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isnt actually overriding transaction names for these events, which means we end up with 'panelkit.boot' for all transactions
No description provided.