Package 

Interface NetworkRequestInstrumentationCallback

    • Method Summary

      Modifier and Type Method Description
      abstract Unit onNetworkRequest(NetworkRequestInfo info) Use this callback to filter network request URLs when generating spans.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • onNetworkRequest

         abstract Unit onNetworkRequest(NetworkRequestInfo info)

        Use this callback to filter network request URLs when generating spans.

        For example:

        config.networkRequestCallback = NetworkRequestInstrumentationCallback { reqInfo ->
          val url = reqInfo.url ?: return@NetworkRequestInstrumentationCallback
          if (url.startsWith("http://my-api.com/uninteresting/")) {
            // Don't generate spans for these
            reqInfo.url = null
          } else if (url.endsWith("/changeme")) {
            // Generate a span, but report a different URL
            reqInfo.url = url.dropLast(9) + "/changed"
          }
          // Otherwise, just create a span with the given URL
        }