Example: demonstrates how to use opentelemetry-kotlin to capture a span and a log#1237
Closed
fractalwrench wants to merge 1 commit into
Closed
Example: demonstrates how to use opentelemetry-kotlin to capture a span and a log#1237fractalwrench wants to merge 1 commit into
fractalwrench wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1237 +/- ##
==========================================
- Coverage 64.29% 64.27% -0.03%
==========================================
Files 142 142
Lines 3011 3009 -2
Branches 296 297 +1
==========================================
- Hits 1936 1934 -2
Misses 998 998
Partials 77 77 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d2af2a5 to
dbc1dd3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
This changeset demonstrates how to use opentelemetry-kotlin to capture a span and a log. This isn't meant to be merged - it's meant to start a discussion about how
opentelemetry-kotlincould be used inopentelemetry-android, and make it easier for folks to play around with the API for themselves if they wish.I've converted the crash instrumentation to capture a log using the Kotlin API (see
CrashReporter). The slow rendering instrumentation captures a span (seeSpanBasedJankReporter)Compatibility
opentelemetry-kotlinhas been designed so that it's easy to dip toes into the water to try things out. The Java API'sOpenTelemetrysymbol can be converted to the Kotlin API by callingtoOtelKotlinApi()- under the hood this just decorates the Java implementation with a Kotlin API. It's also possible to access the underlying implementation viatoOtelJavaApi(), and there are various hooks to convert between objects.opentelemetry-kotlinhas 2 modes: it can decorate theopentelemetry-javaSDK, or use theopentelemetry-kotlinimplementation. In the current configuration this decorates theopentelemetry-javaimplementation.In future if
opentelemetry-kotlinwas the only API used inopentelemetry-android, it would be possible to switch over to the Kotlin implementation as both use the same API.