Skip to content

4.0.0 Custom Instrumentation spans not working #1223

Closed
@sysmat

Description

@sysmat

Platform:

  • Android -> If yes, which Device API (and compileSdkVersion/targetSdkVersion/Build tools) version?
  • Java -> If yes, which Java (and sourceCompatibility/targetCompatibility) version?
  • Kotlin -> If yes, which Kotlin (and jvmTarget) version?
  • NDK -> If yes, which NDK/CMake version?
  • React-Native -> If yes, which version?
  • Timber -> If yes, which version?
  • Log4j2 -> If yes, which version?
  • Logback -> If yes, which version?
  • Spring -> If yes, which version?

IDE:

  • Android Studio -> If yes, which version?
  • IntelliJ -> If yes, which version?
  • Other -> NetBaens 12?

Build system:

  • Gradle -> If yes, which version?
  • Buck -> If yes, which version?
  • Bazel -> If yes, which version?
  • Maven -> If yes, which version?
  • Other -> If yes, which one?

Android Gradle Plugin:

  • Yes -> If yes, which version?
  • No

Sentry Android Gradle Plugin:

  • Yes -> If yes, which version?
  • No

Proguard/R8:

  • Enabled
  • Disabled

Platform installed with:

  • JCenter
  • Bintray
  • Maven Central
  • Manually

The version of the SDK:
io.sentry:sentry:4.0.0


I have the following issue:

Steps to reproduce:

public List<Org> getOrgsFamaly() {        
        ITransaction transaction = Sentry.startTransaction("getOrgsFamaly()");
        transaction.setOperation("famaly");

        List<Org> result = new ArrayList<>();
        result.add(build(4, 2));
        result.add(build(2, 3));

        transaction.finish();
        return result;
}

private Org build(int childrens, int leafs){
        ISpan span = Sentry.getSpan();
       // span is always null
        if(nonNull(span)){
            ISpan innerSpan = span.startChild("famaly", "childes_"+childrens+"::leafs_"+leafs);
            Org org = new Org(childrens, leafs);
            innerSpan.finish();
            return org;
        }

        return null;
    }

Actual result:

  • span is always null

Expected result:

  • To have spans inside one transaction

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions