Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/monosoul/kotlin-coroutines-datadog-tracing
Repo to demonstrate the difference between tracing approaches
https://github.com/monosoul/kotlin-coroutines-datadog-tracing
Last synced: about 2 months ago
JSON representation
Repo to demonstrate the difference between tracing approaches
- Host: GitHub
- URL: https://github.com/monosoul/kotlin-coroutines-datadog-tracing
- Owner: monosoul
- Created: 2023-03-27T11:40:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-03-27T14:10:26.000Z (over 1 year ago)
- Last Synced: 2023-08-02T22:07:48.531Z (over 1 year ago)
- Language: Kotlin
- Size: 147 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kotlin-coroutines-datadog-tracing
Repo to de
monstrate the difference between tracing approachesTo run DD agent container:
```shell
docker run -it --cgroupns host \
--pid host \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /proc/:/host/proc/:ro \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
-p 127.0.0.1:8126:8126/tcp \
-e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true \
-e DD_APM_ENABLED=true \
-e DD_APM_NON_LOCAL_TRAFFIC=true \
-e DD_API_KEY=$DD_API_KEY \
-e DD_SITE="datadoghq.eu" \
gcr.io/datadoghq/agent:latest
```To run the app with DD agent and coroutines instrumentation enabled:
```shell
./gradlew runTheApp
```### The app will repeatedly generate 2 traces:
1. One using the methods annotated with `@Trace` annotation
2. One using the methods instrumented imperatively with helper functions
(see kotlin/dev/monosoul/coroutines/tracing/TracingUtils.kt)### In the first case the trace will look like this:
![with_annotation.png](assets%2Fwith_annotation.png)### In the second case the trace will look like this:
![with_helpers.png](assets%2Fwith_helpers.png)As you can see there are no breaks in the traces in the second case,
also the span hierarchy looks better there.