Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracing API refactoring and fixes #32573

Merged
merged 20 commits into from
Jan 18, 2023
Merged

Conversation

lmolkova
Copy link
Member

@lmolkova lmolkova commented Dec 12, 2022

Fixes: #24086, #28953, (partially) #21686 as a preparation for tracing plugin GA (#30557)

Tracing perf impact (core perf tests):

  • small files: tracing --binary-data-source bytes --parallel 32 --size 10240 --include-pipeline-policies -d 60

    • noop tracer implementation ~3.5% lower throughput
    • full otel implementation with noop exporter (no sampling) - ~9.5% impact
  • small blobs: tracing --binary-data-source blobs--parallel 32 --size 10240 --include-pipeline-policies -d 60

    • noop tracer implementation 1.7% lower throughput
    • full otel implementation with noop exporter (no sampling) - 4.2% impact
  • big files (10485760 bytes)

    • noop tracer implementation 1.5% lower throughput
    • full otel implementation with noop exporter (no sampling) - 1.8% impact
  • big blobs (10485760 bytes) - no impact detected

Prototyped changes for ServiceBus, Cosmos, and Spring Sleuth: https://github.com/lmolkova/azure-sdk-for-java/tree/tracing-versioning

@ghost ghost added the Azure.Core azure-core label Dec 12, 2022
@lmolkova lmolkova changed the title Tracing versioning core Tracing API refactoring and fixes Dec 12, 2022
@azure-sdk
Copy link
Collaborator

azure-sdk commented Dec 12, 2022

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-core
azure-core-tracing-opentelemetry

@lmolkova lmolkova force-pushed the tracing-versioning-core branch from 4c975cd to 377f840 Compare January 5, 2023 23:32
return null;
} catch (Throwable e) {
throw new RuntimeException(e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: We should inspect the type of Throwable, if this is an Error we shouldn't wrapped it and just re-throw it. Also if the Throwable is already a RuntimeException there is no need to wrap it either

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throwable comes from MethodHandle.invoke definition and it's the other way around - RuntimeException is Throwable so I have to wrap it or log and return null. Previously we returned null if something didn't go well, so I switched back to this behavior and added some logs.

@lmolkova lmolkova force-pushed the tracing-versioning-core branch from 6c8adcc to 2ed4f7a Compare January 13, 2023 21:22
Copy link
Member

@alzimmermsft alzimmermsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this PR we should do a performance test on creating ExpandableStringEnums in a hot loop to verify there is no major regressions

@lmolkova
Copy link
Member Author

lmolkova commented Jan 18, 2023

After this PR we should do a performance test on creating ExpandableStringEnums in a hot loop to verify there is no major regressions

Did a quick benchmark:

Benchmark.expandableNew      avgt    6  594.741 ± 145.889  ns/op
Benchmark.expandableOld      avgt    6  1158.933 ± 145.187  ns/op
    @Benchmark
    public void expandableOld(Blackhole blackhole) {
        blackhole.consume(Expandable.fromString_vOld(UUID.randomUUID().toString()));
    }

    @Benchmark
    public void expandableNew(Blackhole blackhole) {
        blackhole.consume(Expandable.fromString(UUID.randomUUID().toString()));
    }

@lmolkova lmolkova merged commit b3c847d into Azure:main Jan 18, 2023
xinlian12 pushed a commit to xinlian12/azure-sdk-for-java that referenced this pull request Jan 24, 2023
* Tracing: support configuration and versioning and API cleanup
mikeharder added a commit to Azure/azure-sdk-tools that referenced this pull request Feb 8, 2023
- Fixes build break running perf tests on older package versions caused by Azure/azure-sdk-for-java#32573
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core azure-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE REQ] The SDK Event Hubs service client builder can not use a custom TraceProvider
4 participants