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 Quartz and Apache Camel preview instrumentations #1899

Merged
merged 7 commits into from
Oct 5, 2021

Conversation

trask
Copy link
Member

@trask trask commented Oct 5, 2021

Resolves #1897
Resolves #1898

@trask trask changed the title Add Quartz preview instrumentation Add Quartz and Apache Camel preview instrumentations Oct 5, 2021
@@ -71,11 +71,17 @@ static Config getConfig(Configuration config) {
if (!config.instrumentation.springScheduling.enabled) {
properties.put("otel.instrumentation.spring-scheduling.enabled", "false");
}
if (!config.preview.instrumentation.apacheCamel.enabled) {
properties.put("otel.instrumentation.apache-camel.enabled", "false");
Copy link
Contributor

Choose a reason for hiding this comment

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

this is off by default.. should check for enabled and then set it to true?

Copy link
Member Author

Choose a reason for hiding this comment

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

otel.instrumentation.apache-camel.enabled is true by default

Copy link
Contributor

Choose a reason for hiding this comment

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

DisabledByDefaultInstrumentation is disabled by default. If it's true, this object doesn't seem right.

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'm not following, can you make a specific suggestion?

if (config.preview.instrumentation.grizzly.enabled) {
// grizzly instrumentation is off by default
// TODO (trask) investigate if grizzly instrumentation can be enabled upstream by default now
properties.put("otel.instrumentation.grizzly.enabled", "true");
}
if (!config.preview.instrumentation.quartz.enabled) {
properties.put("otel.instrumentation.quartz.enabled", "false");
Copy link
Contributor

Choose a reason for hiding this comment

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

same 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.

same here

@@ -49,7 +49,9 @@
SPRING_INTEGRATION_DISABLED(19),
LEGACY_PROPAGATION_DISABLED(20),
GRIZZLY_DISABLED(21), // preview instrumentation
STATSBEAT_DISABLED(22); // disable non-essential statsbeat
STATSBEAT_DISABLED(22), // disable non-essential statsbeat
QUARTZ_DISABLED(23), // preview instrumentation
Copy link
Contributor

Choose a reason for hiding this comment

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

QUARTZ_ENABLED?

Copy link
Member Author

Choose a reason for hiding this comment

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

just following existing convention, do u want to change it for grizzle and spring integration also?

Copy link
Contributor

Choose a reason for hiding this comment

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

grizzly is disabled by default though. which convention are you referring to?

Copy link
Contributor

Choose a reason for hiding this comment

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

yup, GRIZZLY_ENABLED makes more sense in this case.

Copy link
Member Author

Choose a reason for hiding this comment

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

all preview instrumentations are disabled by default

Copy link
Contributor

Choose a reason for hiding this comment

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

except statsbeat is on by default. check overrideconfig, grizzly check enabled and then set it because its default is false.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can I suggest that you push commit to this PR to update Statsbeat tracking to the way you would like it to be?

STATSBEAT_DISABLED(22); // disable non-essential statsbeat
STATSBEAT_DISABLED(22), // disable non-essential statsbeat
QUARTZ_DISABLED(23), // preview instrumentation
APACHE_CAMEL_DISABLED(24); // preview instrumentation
Copy link
Contributor

Choose a reason for hiding this comment

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

APACHE_CAMEL_ENABLED?

Copy link
Member Author

Choose a reason for hiding this comment

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

just following convention, do you want to change it for existing too?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, please.

Copy link
Contributor

@heyams heyams Oct 5, 2021

Choose a reason for hiding this comment

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

or i can clean up after your pr, just fix yours for now. i think other instrumentations were moved recently from instrumentation to preview.

@@ -129,9 +129,15 @@ void trackConfigurationOptions(Configuration config) {
}

// preview instrumentation
if (!config.preview.instrumentation.apacheCamel.enabled) {
Copy link
Contributor

Choose a reason for hiding this comment

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

check enabled not negation?

Copy link
Member Author

Choose a reason for hiding this comment

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

again, just following convention, let me know if you want to change it for existing too

Copy link
Contributor

Choose a reason for hiding this comment

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

feature tracking is based on default value.. if it's off by default, we track on; on by default, we track off..
in this case, DisabledByDefaultInstrumentation is off by default.. here only check for false, which seems wrong.

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 agree what you suggest would be better, but that's not how current features work, do you want me to change the existing convention?

Copy link
Contributor

Choose a reason for hiding this comment

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

i think it's because moving config from instrumentation to preview make it confusing.. under instrumentation, it's on by default.. now preview default is off.. once it moves to preview, we change the default value.. that's why feature needs to be updated as well to reflect this change.

Copy link
Member Author

Choose a reason for hiding this comment

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

@heyams please send a commit to this PR to update statsbeat the way you want it

if (!config.preview.instrumentation.grizzly.enabled) {
featureList.add(Feature.GRIZZLY_DISABLED);
}
if (!config.preview.instrumentation.quartz.enabled) {
Copy link
Contributor

Choose a reason for hiding this comment

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

same 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.

same here

@@ -39,6 +39,7 @@ dependencies {
exclude("ch.qos.logback", "logback-core")
}

implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-apache-camel-2.20:$otelInstrumentationAlphaVersion")
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to add this to the instrumentation list?

Copy link
Member Author

Choose a reason for hiding this comment

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

isn't that what this does?

    INSTRUMENTATION_MAP.put("io.opentelemetry.quartz-2.0", 70);
    INSTRUMENTATION_MAP.put("io.opentelemetry.apache-camel-2.20", 71);

@@ -106,6 +107,7 @@ dependencies {
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-annotations-1.0:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-api-1.0:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-opentelemetry-api-metrics-1.0:$otelInstrumentationAlphaVersion")
implementation("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-quartz-2.0:$otelInstrumentationAlphaVersion")
Copy link
Contributor

Choose a reason for hiding this comment

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

instrumentation list?

Copy link
Member Author

Choose a reason for hiding this comment

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

isn't that what this does?

    INSTRUMENTATION_MAP.put("io.opentelemetry.quartz-2.0", 70);
    INSTRUMENTATION_MAP.put("io.opentelemetry.apache-camel-2.20", 71);

Comment on lines 74 to 76
if (config.preview.instrumentation.apacheCamel.enabled) {
// apache-camel instrumentation is off by default
properties.put("otel.instrumentation.apache-camel.enabled", "true");
Copy link
Member Author

Choose a reason for hiding this comment

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

this won't work, apache-camel is enabled by default in otel

Copy link
Contributor

@heyams heyams Oct 5, 2021

Choose a reason for hiding this comment

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

that's the confusing part.. preview instrumentation is off by default. are you saying that otel will enable it by disregarding the json config setting?

Copy link
Contributor

Choose a reason for hiding this comment

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

where is the otel code to enable it?
are you saying that, DisabledByDefaultInstrumentation is off by default, but otel turned it on at runtime.

Copy link
Member Author

Choose a reason for hiding this comment

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

core otel instrumentation is on by default. our configuration layer reverses that for our distro

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

i only found apache camel and grizzly in that list.. quartz and springIntegration are not mentioned though.

Comment on lines 83 to 89
if (config.preview.instrumentation.quartz.enabled) {
// quartz instrumentation is off by default
properties.put("otel.instrumentation.quartz.enabled", "true");
}
if (!config.preview.instrumentation.springIntegration.enabled) {
properties.put("otel.instrumentation.spring-integration.enabled", "false");
if (config.preview.instrumentation.springIntegration.enabled) {
// springIntegration instrumentation is off by default
properties.put("otel.instrumentation.spring-integration.enabled", "true");
Copy link
Member Author

Choose a reason for hiding this comment

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

same with these

Comment on lines 51 to 52
GRIZZLY_DISABLED(21), // preview instrumentation
GRIZZLY_ENABLED(21), // preview instrumentation, grizzly is OFF by default in OTEL
Copy link
Member Author

Choose a reason for hiding this comment

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

@heyams just a heads up, I'm hoping this changes, and grizzly instrumentation can be on by default in the future, not sure if it changes your thoughts on tracking or not though

Copy link
Contributor

@heyams heyams Oct 5, 2021

Choose a reason for hiding this comment

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

that's fine.. when that happens, i can rename to disabled then and update featurestatsbeat accordingly.
we want to track the non-default config settings.

@heyams heyams merged commit c8f0ba3 into main Oct 5, 2021
@trask trask deleted the add-quartz-preview-instrumentation branch October 18, 2021 00:56
@kryalama kryalama added this to the 3.2.0 (GA) milestone Oct 21, 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
3 participants