Skip to content

Fix sampling for custom instrumentation#2513

Merged
trask merged 4 commits into
mainfrom
fix-sampling-for-custom-instrumentation
Sep 15, 2022
Merged

Fix sampling for custom instrumentation#2513
trask merged 4 commits into
mainfrom
fix-sampling-for-custom-instrumentation

Conversation

@trask

@trask trask commented Sep 12, 2022

Copy link
Copy Markdown
Member

No description provided.

@trask trask force-pushed the fix-sampling-for-custom-instrumentation branch from c238ba1 to 401423d Compare September 12, 2022 01:34
@trask trask force-pushed the fix-sampling-for-custom-instrumentation branch from 401423d to 7b6f48d Compare September 12, 2022 01:51
@trask trask marked this pull request as ready for review September 12, 2022 04:25
@trask trask force-pushed the fix-sampling-for-custom-instrumentation branch from 2c6e355 to 7b6f48d Compare September 12, 2022 20:38
Comment thread agent/instrumentation/methods/README.md Outdated
@@ -0,0 +1,3 @@
This is a copy of the upstream methods instrumentation module, but changed to emit SERVER spans

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.

can we add this note to MethodSingletons class? it used SpanKindExtractor.alwaysServer(). and then delete this readme?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

sure, ptal

// Licensed under the MIT License.

package io.opentelemetry.javaagent.instrumentation.micrometer;
package io.opentelemetry.javaagent.instrumentation.micrometer.ai;

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.

upstream adds a new package for app insights specifically?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

no, this is to avoid conflicting with upstream's package name (which already uses io.opentelemetry.javaagent.instrumentation.micrometer)

import net.bytebuddy.implementation.bytecode.assign.Assigner;
import net.bytebuddy.matcher.ElementMatcher;

public class MethodInstrumentation implements TypeInstrumentation {

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.

can we make a note that this is a temporary solution and long-term solution upstream might be feasible in the near future?

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.

is this identical to upstream methodInstrumentation?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have created a work item for long-term solution

properties.put("otel.instrumentation.log4j-context-data.enabled", "true");
properties.put("otel.instrumentation.logback-mdc.enabled", "true");
properties.put("otel.instrumentation.methods.enabled", "true");
properties.put("otel.instrumentation.ai-methods.enabled", "true");

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

they have to match

@trask trask added this to the 3.4.0 milestone Sep 14, 2022
@trask trask mentioned this pull request Sep 15, 2022
@trask trask merged commit 269a8ce into main Sep 15, 2022
@trask trask deleted the fix-sampling-for-custom-instrumentation branch September 15, 2022 20:31
trask added a commit that referenced this pull request Sep 16, 2022
heyams pushed a commit that referenced this pull request Sep 16, 2022
heyams pushed a commit that referenced this pull request Sep 16, 2022
heyams pushed a commit that referenced this pull request Sep 16, 2022
heyams pushed a commit that referenced this pull request Sep 16, 2022
heyams pushed a commit that referenced this pull request Sep 16, 2022
heyams pushed a commit that referenced this pull request Sep 16, 2022
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.

2 participants