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

Automatically Generate Instrumentation Documentation #13449

Merged
merged 9 commits into from
Mar 7, 2025

Conversation

jaydeluca
Copy link
Member

@jaydeluca jaydeluca commented Mar 4, 2025

Related to #13468

This was a bit of an experiment to see how far I could get with doing some basic code analysis to programmatically identify metadata about different instrumentations in order to automate some documentation.

What this does:

  • Parses file structure in the instrumentation directory to identify each instrumentation, which group or "namespace" they belong to, and extracts information about whether it has library or javaagent support.
  • Parses gradle files to extract muzzle and dependency configurations in order to try and identify which versions of the libraries are supported
  • Outputs results to a new documentation file in yaml format at docs/instrumentation-list.yaml

One idea is that we could run this as part of our release process and as instrumentations change between versions, this should give us a diff with insights into the library versions. It can hopefully also be used to automate the start of some other documentation, like individual instrumentation readme's, our supported libraries page, or information on the documentation website.

@zeitlinger is also experimenting with some other potential use cases.

@jaydeluca jaydeluca marked this pull request as ready for review March 5, 2025 00:22
@jaydeluca jaydeluca requested a review from a team as a code owner March 5, 2025 00:22
Copy link
Member

@zeitlinger zeitlinger left a comment

Choose a reason for hiding this comment

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

great PR!

@zeitlinger
Copy link
Member

@zeitlinger is also experimenting with some other potential use cases.

it can be used now: https://github.com/grafana/otel-checker?tab=readme-ov-file#java

(it includes the file from this PR directly)

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

nice! I'd propose to make the one change from JAVAAGENT/LIBRARY to javaagent/library if that makes sense to you, and then we merge as a baseline and consider the other comments as just ideas for follow-ups

Comment on lines 36 to 39
JAVAAGENT:
- com.alibaba:druid:(,)
LIBRARY:
- com.alibaba:druid:1.0.0
Copy link
Member

Choose a reason for hiding this comment

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

just a preference:

Suggested change
JAVAAGENT:
- com.alibaba:druid:(,)
LIBRARY:
- com.alibaba:druid:1.0.0
javaagent:
- com.alibaba:druid:(,)
library:
- com.alibaba:druid:1.0.0

srcPath: instrumentation/apache-httpclient/apache-httpclient-4.3
target_versions:
LIBRARY:
- org.apache.httpcomponents:httpclient:4.3
Copy link
Member

Choose a reason for hiding this comment

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

we could potentially find the upperbound via the latestDepTestLibrary declaration

srcPath: instrumentation/apache-httpclient/apache-httpclient-4.0
target_versions:
JAVAAGENT:
- io.dropwizard:dropwizard-client:(,3.0.0)
Copy link
Member

Choose a reason for hiding this comment

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

might be nice to exclude dropwizard here somehow

Comment on lines +284 to +285
- org.elasticsearch:elasticsearch:[6.0.0,8.0.0)
- org.elasticsearch.client:transport:[6.0.0,)
Copy link
Member

Choose a reason for hiding this comment

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

might be nice to only include the "primary" target somehow

Suggested change
- org.elasticsearch:elasticsearch:[6.0.0,8.0.0)
- org.elasticsearch.client:transport:[6.0.0,)
- org.elasticsearch.client:transport:[6.0.0,)

Comment on lines +316 to +317
- com.twitter:finagle-http_2.13:[23.11.0,]
- com.twitter:finagle-http_2.12:[23.11.0,]
Copy link
Member

Choose a reason for hiding this comment

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

makes sense to keep both of these though (since just reflecting different scala versions)

JAVAAGENT:
- com.github.oshi:oshi-core:[5.3.1,)
LIBRARY:
- com.github.oshi:oshi-core:$oshiVersion
Copy link
Member

Choose a reason for hiding this comment

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

I'd be in favor of just bumping oshi min version to 5.5.0 and getting rid of the conditional for arm mac, it's still reasonably old version and I don't think it's a very popular instrumentation

@trask trask merged commit 0cfd2d9 into open-telemetry:main Mar 7, 2025
85 checks passed
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.

3 participants