elastic / elastic/apm-agent-android

Trying to connect elastic agent using kotlin (native android) with flutter using channel and send spans manually

Open
#336 5 comments 0 reactions 0 assignees View on GitHub
agent-android agent-mobile community triage
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.