-
Notifications
You must be signed in to change notification settings - Fork 44
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
Initialization hooks #196
Initialization hooks #196
Changes from all commits
5d471c2
b4e129f
6aa6de5
5483388
d234fa5
e5b0b6b
1efda6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.android.instrumentation.startup | ||
|
||
import io.opentelemetry.api.OpenTelemetry | ||
|
||
/** | ||
* Provides callbacks to know the sate of the initialization. | ||
*/ | ||
interface InitializationListener { | ||
/** | ||
* Called when the RUM initialization starts. | ||
*/ | ||
fun onStart() | ||
|
||
/** | ||
* Called when the RUM initialization ends. | ||
* @param openTelemetry - The initialized OpenTelemetry instance. | ||
*/ | ||
fun onEnd(openTelemetry: OpenTelemetry) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if this was There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, though now that I think about the whole thing after the proposal I wrote yesterday, it seems to me that these hooks might overlap with instrumentation installers. So maybe it's not needed to add another, similar mechanism if we decide to make that one public? |
||
} |
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.
We have found it helpful in upstream to have default no-op bodies for some of these, so that implementations only need to override the parts they actually care about. What do you think?
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.
Sounds good! I tend to forget that interfaces' default functions exist 😅