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

add span stacktrace config option #1414

Merged
merged 16 commits into from
Sep 16, 2024

Conversation

SylvainJuge
Copy link
Contributor

@SylvainJuge SylvainJuge commented Aug 14, 2024

Description:

Span stacktrace module can't use autoconfiguration for now as it relies on a strict ordering of the span processors. The addition of OnEnding callback would unblock this but it's not available yet (open-telemetry/opentelemetry-java#6367).

While autoconfiguration is still not supported, this PR adds a way to provide a ConfigProperties for configuration, which allows to

  • define configuration option and default value
  • implement configuration in a consistent way across usages

Configuration option name otel.java.experimental.span-stacktrace.min.duration
Default value: 5ms

span-stacktrace/README.md Outdated Show resolved Hide resolved
SylvainJuge and others added 3 commits August 14, 2024 18:08
Co-authored-by: jackshirazi <jacks@fasterj.com>
Co-authored-by: jackshirazi <jacks@fasterj.com>
Co-authored-by: jackshirazi <jacks@fasterj.com>
@SylvainJuge SylvainJuge changed the title define span stacktrace config constants add span stacktrace config option Aug 19, 2024
Co-authored-by: jackshirazi <jacks@fasterj.com>
span-stacktrace/README.md Outdated Show resolved Hide resolved
@trask trask added this to the v1.39.0 milestone Aug 22, 2024
@SylvainJuge
Copy link
Contributor Author

As discussed yesterday SIG we can't mark the feature as stable in part because it relies on an unstable semconv attribute code.stacktrace.

While we work on making this code.stacktrace a stable semconv attribute, we should still be able to merge this PR with an experimental configuration option otel.java.experimental.span-stacktrace.min.duration, so at least add support for some configuration.

So here I think this PR is ready for review and we should be able to merge it as-is until we manage to make progress on making the feature stable.

@trask @jack-berg does it sounds like a good next step for this ?

.build();

OpenTelemetrySdk sdk = OpenTelemetrySdk.builder().setTracerProvider(tracerProvider).build();
```

### Configuration

The `otel.java.experimental.span-stacktrace.min.duration` configuration option (defaults to 5ms) allows configuring
Copy link
Member

Choose a reason for hiding this comment

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

The delimiter situation is always a bit hard.. Thoughts:

  • The autoconfigure module automatically turns any - into ., so there doesn't seem to be any point in introducing other delimeters.
  • I could see this evolving to have a log record processor one day, in which case nesting the properties under otel.java.experimental.stacktrace.* (or otel.java.experimental.stacktraceprocessor.*) would allow for a more uniform property schema. But on the other hand, the component is currently named *-span-stacktrace - maybe the component name is worth revisiting?
Suggested change
The `otel.java.experimental.span-stacktrace.min.duration` configuration option (defaults to 5ms) allows configuring
The `otel.java.experimental.stacktrace.span.min.duration` configuration option (defaults to 5ms) allows configuring

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm fine to remove - and replace it with ., for now we just need to have one configuration option to start, we will of course need to revise this later when making this feature stable.

I think the suggestion to use - in the feature name came from what we currently have for otel.java.experimental.span-attributes.copy-from-baggage.include in the baggage-processor, which by the way isn't really consistent as we have otel.java.experimental.span-attributes as prefix for a module named baggage-processor.

As long as things are not marked as stable, I think those minor inconsistencies are fine and acceptable, especially in the contrib repo where things are mostly alpha.


However we probably need to have some proper definition somewhere about those configuration options, for example to at least define what are the main namespaces like otel.java.*, otel.javaagent.* or otel.java.experimental.* or even define a global registry with all the possible options to ensure there isn't any conflict between all the repositories. Also, this might be something also happening in other platforms & otel components SIGs.

However that's definitely something that will take a while and should be covered separately, and I know that it sounds like "let's start another SIG about configuration options" 😄 .

Copy link
Member

Choose a reason for hiding this comment

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

Ha - well unfortunately I doubt we'll get any additional clarity around property naming anytime soon. There's already a dedicated config sig (which I lead), focussing on building out declarative configuration which aims to replace the system property / env var config scheme as the dominant mechanism for configuration. That's where all the configuration effort is being spent these days.

I think you're right to stick with precedents that already exist in this repo - I wasn't aware of those.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, then let's stick to otel.java.experimental.span-stacktrace.min.duration for now if you agree and we can always change it later as it's experimental, we can even still support the current experimental config for as long as we'd like.

@SylvainJuge SylvainJuge closed this Sep 6, 2024
@SylvainJuge SylvainJuge deleted the span-stacktrace-config branch September 6, 2024 14:02
@SylvainJuge SylvainJuge restored the span-stacktrace-config branch September 6, 2024 14:03
@SylvainJuge
Copy link
Contributor Author

Woops, I deleted the branch by accident, thus just re-opening it with this comment.

@SylvainJuge SylvainJuge reopened this Sep 6, 2024
@trask trask merged commit 1d05953 into open-telemetry:main Sep 16, 2024
27 checks passed
robsunday pushed a commit to robsunday/opentelemetry-java-contrib that referenced this pull request Sep 17, 2024
Co-authored-by: jackshirazi <jacks@fasterj.com>
SylvainJuge added a commit to SylvainJuge/opentelemetry-java-contrib that referenced this pull request Sep 17, 2024
commit b84a73e
Merge: 352202f 7df9862
Author: SylvainJuge <763082+SylvainJuge@users.noreply.github.com>
Date:   Tue Sep 17 11:13:11 2024 +0200

    Merge pull request #2 from SylvainJuge/jmx-scraper-it

    basic JMX client implementation + tests

commit 7df9862
Author: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>
Date:   Tue Sep 17 11:11:50 2024 +0200

    fix bad merge again

commit e4a8f83
Author: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>
Date:   Tue Sep 17 11:10:26 2024 +0200

    fix bad merge again

commit dad197b
Author: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>
Date:   Tue Sep 17 11:09:18 2024 +0200

    fix bad merge

commit f8a73d7
Author: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>
Date:   Tue Sep 17 11:08:42 2024 +0200

    spotless

commit eab01e9
Author: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>
Date:   Tue Sep 17 11:01:47 2024 +0200

    spotless

commit f6667dd
Merge: 5b3ef9d 352202f
Author: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>
Date:   Tue Sep 17 10:55:34 2024 +0200

    Merge branch 'jmx-scrapper' of github.com:SylvainJuge/opentelemetry-java-contrib into jmx-scraper-it

commit 5b3ef9d
Author: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>
Date:   Tue Sep 17 10:51:11 2024 +0200

    add TODOs

commit 352202f
Merge: 5a82aac 40a2591
Author: SylvainJuge <763082+SylvainJuge@users.noreply.github.com>
Date:   Tue Sep 17 10:50:50 2024 +0200

    Merge pull request #1 from robsunday/jmx-scrapper

    Initial commit of JmxScraper code.

commit 40a2591
Author: jack-berg <34418638+jack-berg@users.noreply.github.com>
Date:   Mon Sep 16 16:05:50 2024 -0500

    Add declarative config support for RuleBasedRoutingSampler (open-telemetry#1440)

commit 6d39e93
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Sep 16 10:40:16 2024 -0700

    Update dependency com.uber.nullaway:nullaway to v0.11.3 (open-telemetry#1457)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit eb5dc6f
Author: Bruno Baptista <brunobat@gmail.com>
Date:   Mon Sep 16 18:26:53 2024 +0100

    Fix native mode error cause by static init of random (open-telemetry#862)

commit 5ffa348
Author: jack-berg <34418638+jack-berg@users.noreply.github.com>
Date:   Mon Sep 16 12:23:41 2024 -0500

    Add declarative config support for aws xray propagators (open-telemetry#1442)

commit 151b744
Author: SylvainJuge <763082+SylvainJuge@users.noreply.github.com>
Date:   Mon Sep 16 19:23:19 2024 +0200

    add span stacktrace config option (open-telemetry#1414)

    Co-authored-by: jackshirazi <jacks@fasterj.com>

commit 9ee5fb1
Author: Yury Bubnov <ybubnov@gmail.com>
Date:   Mon Sep 16 10:18:51 2024 -0700

    Issue-1034 Short XRay Trace (open-telemetry#1036)

commit 11a2e1a
Author: Jeffrey Chien <chienjef@amazon.com>
Date:   Mon Sep 16 13:18:10 2024 -0400

    Fix Tomcat metric definitions to aggregate multiple MBeans. (open-telemetry#1366)

commit 9fa44be
Author: Pranav Sharma <sharmapranav@google.com>
Date:   Mon Sep 16 11:22:32 2024 -0400

    Fix incorrect cloud.platform value for GCF (open-telemetry#1454)

commit 11f2111
Author: Peter Findeisen <pfindeis@cisco.com>
Date:   Mon Sep 16 08:21:46 2024 -0700

    Composite Samplers prototype (open-telemetry#1443)

    Co-authored-by: Otmar Ertl <otmar.ertl@gmail.com>

commit b3386de
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Sep 16 08:20:44 2024 -0700

    Update plugin com.squareup.wire to v5.1.0 (open-telemetry#1452)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit 27b631d
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Sep 16 08:20:21 2024 -0700

    Update errorProneVersion to v2.32.0 (open-telemetry#1453)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit 791df4b
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Sep 16 09:50:03 2024 -0500

    Update dependency io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha to v2.8.0-alpha (open-telemetry#1456)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Jack Berg <jberg@newrelic.com>

commit 19357e6
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue Sep 10 15:20:46 2024 -0700

    Update dependency com.gradle.enterprise:com.gradle.enterprise.gradle.plugin to v3.18.1 (open-telemetry#1450)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit 460470b
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue Sep 10 15:20:23 2024 -0700

    Update plugin com.gradle.develocity to v3.18.1 (open-telemetry#1451)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit b45cdab
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue Sep 10 12:32:56 2024 +0300

    Update dependency com.linecorp.armeria:armeria-bom to v1.30.1 (open-telemetry#1449)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit d36106e
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue Sep 10 09:11:26 2024 +0300

    Update micrometer packages to v1.13.4 (open-telemetry#1448)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit fb25c79
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Sep 9 15:44:53 2024 +0300

    Update dependency gradle to v8.10.1 (open-telemetry#1447)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit f847561
Author: robsunday <rniedziela@splunk.com>
Date:   Tue Sep 17 09:22:21 2024 +0200

    Code review changes:
    Argument parsing moved to the main class.
    Argument validation now throw exception.
    More tests added for config factory.
    Created unit tests for JmxScraper class.

commit 03788ff
Author: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>
Date:   Mon Sep 16 17:26:12 2024 +0200

    add TODO for testing server SSL support

commit a3fbeb5
Author: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>
Date:   Mon Sep 16 17:08:16 2024 +0200

    add TODO to enable server-side SSL

commit 1619595
Author: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>
Date:   Mon Sep 16 16:59:17 2024 +0200

    wip

commit 164679f
Author: robsunday <rniedziela@splunk.com>
Date:   Wed Sep 11 12:34:12 2024 +0200

    Cleanup of config.
    Refactoring of JmxScraperConfigFactory.
    Added first unit tests.

commit 165fcb8
Author: robsunday <rniedziela@splunk.com>
Date:   Tue Sep 10 12:36:29 2024 +0200

    Initial commit of JmxScraper code. Application compiles and runs as standalone and can read config file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants