RUM-3397 (otel-tracer) update otel instrumentation guide for Android#23389
Conversation
4e76793 to
58234e9
Compare
ganeshnj
left a comment
There was a problem hiding this comment.
Looks great. Could you add some changes that I did recently in the iOS
- add a link in the original Open Tracing API docs that we support Otel APIs as well (check https://docs-staging.datadoghq.com/ganeshnj/feat/otel-tracer-ios/tracing/trace_collection/automatic_instrumentation/dd_libraries/ios/?tab=cocoapods)
There was a problem hiding this comment.
/informational
We must make sure during the release time, the real version is updated.
There was a problem hiding this comment.
/comment
Let's cleanup the extra spacing like in {{ and ```
There was a problem hiding this comment.
| 4. Datadog tracer implements the [Open Telemetry standard][18]. Create the OpenTelemetryTraceProvider and register the OpenTelemetrySdk as GlobalTelemetry instance in your application's `onCreate()` method. | |
| 4. Datadog tracer implements the [Open Telemetry standard][18]. Create the `OpenTelemetryTraceProvider` and register the `OpenTelemetrySdk` as GlobalTelemetry instance in your application's `onCreate()` method. |
There was a problem hiding this comment.
Given the fact, we don't do anything with instrumentationName, let's make it obvious by passing the empty string.
| val tracerProvider = GlobalOpenTelemetry.get().getTracer(instrumentationName = "<instrumentation_name>") | |
| val tracerProvider = GlobalOpenTelemetry.get().getTracer(instrumentationName = "") |
There was a problem hiding this comment.
yes but in this case I want to stay consistent with Otel. Maybe later one we will use it for something. Not sure here
There was a problem hiding this comment.
| final TracerProvider tracerProvider = GlobalOpenTelemetry.get().getTracer("<instrumentation_name>"); | |
| final TracerProvider tracerProvider = GlobalOpenTelemetry.get().getTracer(""); |
There was a problem hiding this comment.
| Note: The `setService` method is used to set the service name for the tracer provider. The service name is used to identify the application in the Datadog UI. You can either use the GlobalOpenTelemetry to hold a single instance of the TracerProvider create your own instance of the TracerProvider and use it in your application code as needed. | |
| Note: The `setService` method is used to set the service name for the tracer provider. The service name is used to identify the application in the Datadog UI. You can either use the `GlobalOpenTelemetry` to hold a single instance of the `TracerProvider` create your own instance of the `TracerProvider` and use it in your application code as needed. |
There was a problem hiding this comment.
| tracer.spanBuilder("<span_name>").setAttribute("<key_name>", <key_value>).startSpan(); | |
| tracer.spanBuilder("<span_name>").setAttribute("<key_name>", "<key_value>").startSpan(); |
There was a problem hiding this comment.
nope because if we put it like that will mean that <key_value> should always be a string which is not the case at least in Android API
f598d2f to
3f9a200
Compare
|
Thanks! I have created a card for our team to review further: https://datadoghq.atlassian.net/browse/DOCS-8112 |
brett0000FF
left a comment
There was a problem hiding this comment.
Thanks for this! I left a few suggestions and comments. Please let me know if you have any questions or need help with anything. 😄 There are some merge conflicts, so I'm waiting to approve.
|
|
||
| **Note**: If you decide to set the `GlobalOpenTelemetry.set` API you need to make sure that this is only called one single time in your process otherwise OpenTelemetry will throw an exception. In case you want to avoid that you can just create a `TracerProvider` and use it as a singleton in your project. | ||
|
|
||
| **Note**: The `setService` method is used to set the service name for the tracer provider. The service name is used to identify the application in the Datadog UI. You can either use the `GlobalOpenTelemetry` to hold a single instance of the `TracerProvider` create your own instance and use it in your application code as needed. |
There was a problem hiding this comment.
| **Note**: The `setService` method is used to set the service name for the tracer provider. The service name is used to identify the application in the Datadog UI. You can either use the `GlobalOpenTelemetry` to hold a single instance of the `TracerProvider` create your own instance and use it in your application code as needed. |
I think this note is duplicated?
There was a problem hiding this comment.
will double check, tks !!
There was a problem hiding this comment.
I did not find any duplicate, can you please double check it on your end ?
There was a problem hiding this comment.
Hey, apologies for not being clearer. I was referring to the overlap between the note on line 382 and 384. Perhaps these could be combined?
Ensure the GlobalOpenTelemetry.set API is called only once per process. The setService method is used to set the service name for the tracer provider, which identifies the application in Datadog.
You have two options for managing the TracerProvider instance:
- Use GlobalOpenTelemetry to hold a single instance of the TracerProvider. This ensures that the GlobalOpenTelemetry.set API is called only once per process.
- Create your own instance of the TracerProvider and use it as a singleton in your project. This allows you to manage the instance directly in your application code as needed.
| @@ -0,0 +1,327 @@ | |||
| --- | |||
| title: iOS and tvOS Custom Instrumentation using OpenTelemetry API | |||
There was a problem hiding this comment.
We recently published a page for this content: https://docs.datadoghq.com/tracing/trace_collection/custom_instrumentation/ios?tab=cocoapods.
I'm not sure which is most relevant, but we should reconcile these.
There was a problem hiding this comment.
yes I need to rebase this ...this is because it was part of @ganeshnj PR that was merged.
rtrieu
left a comment
There was a problem hiding this comment.
Hi @mariusc83, a few minor suggestions from me!
3f9a200 to
2279085
Compare
25c7395 to
282b505
Compare
…dd_libraries/android.md Co-authored-by: Brett Blue <[email protected]>
…dd_libraries/ios.md Co-authored-by: Brett Blue <[email protected]>
…roid/otel.md Co-authored-by: Brett Blue <[email protected]>
…roid/otel.md Co-authored-by: Brett Blue <[email protected]>
…roid/otel.md Co-authored-by: Brett Blue <[email protected]>
…roid/otel.md Co-authored-by: Brett Blue <[email protected]>
…roid/otel.md Co-authored-by: Brett Blue <[email protected]>
282b505 to
16b6771
Compare
…roid/otel.md Co-authored-by: Rosa Trieu <[email protected]>
…roid/otel.md Co-authored-by: Rosa Trieu <[email protected]>
…roid/otel.md Co-authored-by: Rosa Trieu <[email protected]>
…roid/otel.md Co-authored-by: Rosa Trieu <[email protected]>
…roid/otel.md Co-authored-by: Rosa Trieu <[email protected]>
brett0000FF
left a comment
There was a problem hiding this comment.
Thanks! Just a few minor comments from my end.
…roid/otel.md Co-authored-by: Brett Blue <[email protected]>
…roid/otel.md Co-authored-by: Brett Blue <[email protected]>
…roid/otel.md Co-authored-by: Brett Blue <[email protected]>
5f86c32 to
296a786
Compare
|
/merge |
|
🚂 MergeQueue: waiting for PR to be ready This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals. Use |
|
🚂 MergeQueue: This merge request was already merged This pull request was merged directly. |
What does this PR do? What is the motivation?
This is part of supporting OTel APIs for dd-sdk-android-trace.
Merge instructions
Additional notes