Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Don't double instrument when using instrumented Ktor client with OkHttp engine

Open
#949 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, kotlin
Domain
tooling

Research direction

The issue names the Ktor client integration, OkHttp engine, SAGP auto-instrumentation, and bytecode manipulation, but no files, tests, or entry points. Start by tracing these instrumentation paths and determine whether calls can be detected as doubly instrumented; done means preventing duplicate instrumentation without breaking standalone OkHttp instrumentation.

Written by the indexing model from the issue text.

Description

Android Feature Spans
Problem Statement

We're about to release a Ktor client integration for sentry-java.
If a customer uses Ktor client with our integration, OkHttp as the engine for Ktor client, and SAGP with auto-instrumentation for OkHttp, they will end up with doubly instrumented HTTP calls.
While we're going to document very clearly that they should instrument either one or the other, users might still run into this.
There might be a way to detect if calls are being doubly instrumented and deactivate one of the two instrumentations.

Solution Brainstorm

I'm not sure if this is possible in the first place. The bytecode manipulation code would basically have to detect whether OkHttp is running inside Ktor or on its own.

Dominant language
Kotlin
Stars
184
Forks
41
Avg merge
2d 10m
Merged PRs (30d)
20

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/sentry-android-gradle-plugin

All issues in getsentry/sentry-android-gradle-plugin

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.