Skip to content

Add a new module for extensions to the tracing APIs.#2962

Merged
jkwatson merged 7 commits into
open-telemetry:mainfrom
jkwatson:convenience
Mar 18, 2021
Merged

Add a new module for extensions to the tracing APIs.#2962
jkwatson merged 7 commits into
open-telemetry:mainfrom
jkwatson:convenience

Conversation

@jkwatson

@jkwatson jkwatson commented Mar 2, 2021

Copy link
Copy Markdown
Contributor

Includes one simple possible example.

Everything about this PR is up for modification. This is more of a proposal for some possible convenience APIs and a new module to house them.

I also realize that we could very easily add some kotlin extension functions to Tracer that use this, and that would probably be a nice enhancement for kotlin users.

* <p>Todo: figure out a better name for this.
*/
@SuppressWarnings("InconsistentOverloads")
public class Spanalyzer {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

obviously, this is a ridiculous name. Suggestions extremely welcome.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know it was used in a different way in OpenTracing, but SpanWrapper kind of fits what you're doing here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we also already have an internal class called SpanWrapper that could lead to confusion, but yes, this is one that I had considered.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ExtendedTracer since presumably if moving these into core we'd add to Tracer?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

not bad. Or maybe TracerExtension?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If kotlin, it'd definitely be TracerExtensions :) I guess per Java we'd want to name this what it is, which is an "extended tracer".

@codecov

codecov Bot commented Mar 3, 2021

Copy link
Copy Markdown

Codecov Report

Merging #2962 (feabf44) into main (906c0e8) will increase coverage by 90.72%.
The diff coverage is 95.45%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2962       +/-   ##
===========================================
+ Coverage        0   90.72%   +90.72%     
- Complexity      0     2820     +2820     
===========================================
  Files           0      325      +325     
  Lines           0     8816     +8816     
  Branches        0      885      +885     
===========================================
+ Hits            0     7998     +7998     
- Misses          0      553      +553     
- Partials        0      265      +265     
Impacted Files Coverage Δ Complexity Δ
...etry/extension/incubator/trace/ExtendedTracer.java 95.00% <95.00%> (ø) 4.00 <4.00> (?)
...ntelemetry/sdk/testing/assertj/SpanDataAssert.java 95.00% <100.00%> (ø) 50.00 <1.00> (?)
.../metrics/AbstractSynchronousInstrumentBuilder.java 100.00% <0.00%> (ø) 2.00% <0.00%> (?%)
.../sdk/metrics/aggregator/AbstractSumAggregator.java 100.00% <0.00%> (ø) 8.00% <0.00%> (?%)
.../opentelemetry/sdk/metrics/data/DoubleSumData.java 100.00% <0.00%> (ø) 2.00% <0.00%> (?%)
...porter/jaeger/thrift/JaegerThriftSpanExporter.java 75.00% <0.00%> (ø) 8.00% <0.00%> (?%)
...src/main/java/io/opentelemetry/api/trace/Span.java 91.66% <0.00%> (ø) 24.00% <0.00%> (?%)
...ntelemetry/sdk/metrics/data/ValueAtPercentile.java 100.00% <0.00%> (ø) 2.00% <0.00%> (?%)
...in/java/io/opentelemetry/sdk/trace/SpanLimits.java 100.00% <0.00%> (ø) 6.00% <0.00%> (?%)
...lemetry/exporter/otlp/trace/MarshalerWithSize.java 100.00% <0.00%> (ø) 2.00% <0.00%> (?%)
... and 317 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 906c0e8...feabf44. Read the comment docs.

@anuraaga anuraaga left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems reasonable to me

* <p>Todo: figure out a better name for this.
*/
@SuppressWarnings("InconsistentOverloads")
public class Spanalyzer {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ExtendedTracer since presumably if moving these into core we'd add to Tracer?

@anuraaga

anuraaga commented Mar 7, 2021

Copy link
Copy Markdown
Contributor

@jkwatson By the way, did we want to call this package incubator or do we intend not to move code into the core after getting feedback?

@bogdandrutu

bogdandrutu commented Mar 7, 2021

Copy link
Copy Markdown
Member

My 2 cents here: I think we should not move everything in core, but instead give users a stable extension artifact. This artifact may include helpers for metrics as well.

@anuraaga anuraaga left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Span creation is basically the whole point of OpenTelemetry - so I'm not a fan of splitting our own ecosystem if we keep this in an extension. "Are you using the extended tracer?", either when answering a support request or recommending how to use OpenTelemetry, isn't a question I'd like to have to ask in the long term. So for these, I would go with experimenting with the goal of getting them into core.

This isn't true of less-core features, for example an AttributeFilteringExporter has been asked for a few times I think - it has enough demand that it could probably be in core, but since it's a totally different concept than anything we have, it doesn't feel like a split to have it in an extension too.

@anuraaga anuraaga left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code LGTM - still wondering about extension vs incubator / long-term separation vs migrating into core. I do prefer incubator, but we could still do renames of the artifact after merging if that's better

@jkwatson

Copy link
Copy Markdown
Contributor Author

Code LGTM - still wondering about extension vs incubator / long-term separation vs migrating into core. I do prefer incubator, but we could still do renames of the artifact after merging if that's better

oh, somehow I missed a rename to incubator was desired. I can do that now if you'd like.

@anuraaga

Copy link
Copy Markdown
Contributor

@jkwatson Yeah I think that'd be nice

@jkwatson

Copy link
Copy Markdown
Contributor Author

@jkwatson Yeah I think that'd be nice

Do we want just incubator or tracing-incubator?

@anuraaga

Copy link
Copy Markdown
Contributor

@jkwatson Since API isn't meant to be split like the SDK is, incubator seems ok

@jkwatson

Copy link
Copy Markdown
Contributor Author

Anything left on here to do? Would be nice to have this released as a part of 1.1.0 in a couple of weeks.

jkwatson added 2 commits March 17, 2021 08:14
@jkwatson jkwatson merged commit aac9284 into open-telemetry:main Mar 18, 2021
@jkwatson jkwatson deleted the convenience branch March 18, 2021 01:53
This was referenced Dec 19, 2021
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.

5 participants