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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instrumenter option #2349

Merged
merged 3 commits into from
Nov 14, 2022
Merged

Add instrumenter option #2349

merged 3 commits into from
Nov 14, 2022

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Nov 9, 2022

#skip-changelog

馃摐 Description

This makes startTransaction and startChild no-op if the instrumenter starting the operation doesn't match the configured one.

馃挕 Motivation and Context

To avoid double instrumenting when OTEL is being used.

馃挌 How did you test it?

馃摑 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

馃敭 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2022

Messages
馃摉 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 馃毇 dangerJS against ef5e638

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2022

Performance metrics 馃殌

Plain With Sentry Diff
Startup time 305.02 ms 308.80 ms 3.78 ms
Size 1.73 MiB 2.32 MiB 610.42 KiB

Baseline results on branch: feat/otel-modules

Startup times

Revision Plain With Sentry Diff
efa282a 292.88 ms 336.08 ms 43.21 ms

App size

Revision Plain With Sentry Diff
efa282a 1.73 MiB 2.32 MiB 609.88 KiB

@@ -20,7 +20,10 @@ public interface ISpan {
@ApiStatus.Internal
@NotNull
ISpan startChild(
@NotNull String operation, @Nullable String description, @Nullable Date timestamp);
@NotNull String operation,
Copy link
Member

Choose a reason for hiding this comment

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

if you break this api, won't you have to update every call site of span.startChild?
The way I did in ruby was to have an optional arg instrumenter that defaults to sentry.

Copy link
Member

Choose a reason for hiding this comment

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

it's marked as internal and is only used in a couple of places by ourselves, but I agree, we should probably add a new method overload here

Copy link
Member Author

Choose a reason for hiding this comment

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

I was explicitly trying to avoid more overloads since this was only used in very few places and it felt cleaner to just add the new param in those places. I did update the call sites. Unfortunately no default params in Java 馃槩 .

@romtsn you think we need the overload or can we proceed with the changed method signature? At some point we might want to introduce some sort of param object as we did with startTransaction and TransactionOptions to handle defaults etc.

Copy link
Member

Choose a reason for hiding this comment

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

We can proceed I guess

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

Should we also add a test for SentryTracer changes?

Base automatically changed from feat/otel-modules to feat/otel November 10, 2022 10:05
@adinauer
Copy link
Member Author

adinauer commented Nov 10, 2022

Should we also add a test for SentryTracer changes?

@romtsn These are tested via SpanTest, do we want more?

@romtsn
Copy link
Member

romtsn commented Nov 10, 2022

Should we also add a test for SentryTracer changes?

@romtsn These are tested via SpanTest, do we want more?

ah I missed that, that should be fine then

@adinauer adinauer mentioned this pull request Nov 11, 2022
21 tasks
@getsentry getsentry deleted a comment from Bikashmurmu Nov 14, 2022
@adinauer adinauer merged commit 110ae5e into feat/otel Nov 14, 2022
@adinauer adinauer deleted the feat/otel-instrumenter-option branch November 14, 2022 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants