elastic / elastic/apm-agent-android
Trying to connect elastic agent using kotlin (native android) with flutter using channel and send spans manually
- Dominant language
- Kotlin
- Stars
- 43
- Forks
- 22
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 26
Description
I am trying to connect elastic from flutter to native android using kotlin and log API by sending spans as this example
what is the best way to send spans manually from android native code
~~~bash
private fun sendSpan(endPoint: String, request: String, header: String){
val tracer = GlobalOpenTelemetry.getTracer(instrumentationScopeName)
val span = tracer.spanBuilder(endPoint).startSpan()
span.end()
GlobalOpenTelemetry.get().logsBridge[endPoint.split("/").last()].let {
it.logRecordBuilder().let { logRecord->
logRecord.setBody("REQUEST_HEADER: $header\n\nREQUEST: $request")
logRecord.emit()
}
}
}
~~~
Contributor guide
Assessment
This issue has not been assessed yet.