Add Telemetry for Extension Finder SPIs#11298
Add Telemetry for Extension Finder SPIs#11298mhlidd wants to merge 1 commit intomhlidd/add_extensions_metricfrom
Conversation
| if (name.startsWith(SERVICES_PREFIX)) { | ||
| String fqn = name.substring(SERVICES_PREFIX.length()); | ||
| if (fqn.startsWith(OTEL_NAMESPACE)) { | ||
| OtelSpiCollector.getInstance().recordSpiDetected(fqn, EXTENSIONS_PATH_SOURCE); |
There was a problem hiding this comment.
can we exit here do avoid looping on entries if we already found?
There was a problem hiding this comment.
If the goal here is to report all service files under the OTel namespace then the best we could do is exit on the first entry that doesn't start with the services prefix. That's assuming that the service entries appear in a group, which they usually do. If assume that the service entries are ordered then we could exit on the next entry that doesn't start with the OTel namespace.
However I'd like to know about what we intend to gain from this telemetry since this will incur a non-trivial startup cost, albeit only when extensions are added to the tracer (which is uncommon.)
i.e. if the goal is to survey what SPIs are being added as extensions, even though we don't currently support them then I guess this is the only way to discover that (although it would be a good idea to short-circuit the searching when we get to jar entries that we know should appear after service entries - you can look at some example OTel extension jars to see if there's a pattern.)
What Does This Do
This PR sends metrics for all OTel SPIs that are detected on the existing
ExtensionFinderclass. This effectively tracks any OTel SPI that is registered at any of the JAR files on the path listed byotel.javaagent.extensionsordd.trace.extensions.path.Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.