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

Make GlobalIgnoresMatcher configurable #1952

Closed
pavolloffay opened this issue Dec 21, 2020 · 3 comments · Fixed by #2035
Closed

Make GlobalIgnoresMatcher configurable #1952

pavolloffay opened this issue Dec 21, 2020 · 3 comments · Fixed by #2035
Labels
enhancement New feature or request

Comments

@pavolloffay
Copy link
Member

Is your feature request related to a problem? Please describe.

I want to instrument java.io.InputStream and java.io.OutputStream e.g. https://github.com/hypertrace/javaagent/blob/c320487308481c4ca7a90ec0f5b054ea1788e7c2/instrumentation/java-streams/src/main/java/io/opentelemetry/javaagent/instrumentation/hypertrace/java/inputstream/InputStreamInstrumentationModule.java#L71

The core configuration ignores almost all types from java. package, hence my instrumentation does not work on e.g. ByteArrayInputStream etc.

Describe the solution you'd like

Make the GlobalIgnoresMatcher configurable.

@pavolloffay
Copy link
Member Author

any proposals how to make the global ignore matchers configurable?

@anuraaga
Copy link
Contributor

Do you think a simple csv property of excluded prefixes could cut it? So we wouldn't be able to filter on the exclude, but it is the simplest form of configurability I think. Wondering if it's enough for the use case.

@pavolloffay
Copy link
Member Author

Do you think a simple csv property of excluded prefixes could cut it?

There are two use cases: 1. adding more exclusion patterns and 2. including some classes that the upstream excludes (my use-case). Given how the exclusion is written it will be better to provide a customized implementation.

A programmatic SPI will be probably more flexible and optimized. Here is some proposal:

interface GlobalIgnoresMatcherProvider {
  <T extends TypeDescription> ElementMatcher.Junction<T> type();
 ElementMatcher.Junction.AbstractBase<ClassLoader> classloader();

// or order
int priority();
}

The matcher with the highest priority/order will be installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants