Skip to content

[autoinstrumentation] add ruby autoinstrumentation #3756

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

xuan-cao-swi
Copy link

Description:

Add the initial version of autoinstrumentation ruby (image and crd change).

Link to tracking Issue(s):

Testing:

  • e2e-instrumentation and e2e-multi-instrumentation are performed; but hopefully they can be added after autoinstrumentation-ruby image gets publish first.
  • Also did general local testing (demo 00:13:25 ~ 00:16:44)

Documentation:
Added doc in docs/api/instrumentations.md

@xuan-cao-swi xuan-cao-swi requested a review from a team as a code owner February 28, 2025 18:03
@swiatekm
Copy link
Contributor

swiatekm commented Mar 3, 2025

@xuan-cao-swi thank you for the contribution! It's clear you put a lot of effort into it.

That said, before we can proceed with code review, we'll need to discuss how exactly we want to go about introducing this new autoinstrumentation to the operator. Could you open an issue and describe how it works? Adding a new instrumentation is a very big change with major implications for the maintainability of this project, and we need to make sure we do it right.

@@ -0,0 +1,140 @@
# frozen_string_literal: true
Copy link
Contributor

Choose a reason for hiding this comment

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

could this code live in the ruby SDK instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

This would be great

Copy link
Author

Choose a reason for hiding this comment

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

Sure, I was looking at nodejs autoinstrumentation and now I just saw the latest pr removed that ts script (will do the same)

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make that change in the ruby auto-inst prior to merging this?

Copy link
Contributor

@atoulme atoulme left a comment

Choose a reason for hiding this comment

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

Changes LGTM

@atoulme
Copy link
Contributor

atoulme commented Mar 12, 2025

Would it make sense for you to step up as codeowner of those files moving forward to help maintain Ruby auto-instrumentation?

@@ -0,0 +1,140 @@
# frozen_string_literal: true
Copy link
Contributor

Choose a reason for hiding this comment

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

This would be great

Co-authored-by: Antoine Toulme <antoine@toulme.name>
@xuan-cao-swi
Copy link
Author

Would it make sense for you to step up as codeowner of those files moving forward to help maintain Ruby auto-instrumentation?

Yes, I'd like to help maintain the ruby auto-instrumentation.

@swiatekm
Copy link
Contributor

I've added this point to the agenda for today's SIG meeting. Anyone interested is encouraged to join in on the discussion. You can find the calendar here.

main.go Outdated
@@ -151,6 +153,7 @@ func main() {
pflag.BoolVar(&enableDotNetInstrumentation, constants.FlagDotNet, true, "Controls whether the operator supports dotnet auto-instrumentation")
pflag.BoolVar(&enableGoInstrumentation, constants.FlagGo, false, "Controls whether the operator supports Go auto-instrumentation")
pflag.BoolVar(&enablePythonInstrumentation, constants.FlagPython, true, "Controls whether the operator supports python auto-instrumentation")
pflag.BoolVar(&enableRubyInstrumentation, constants.FlagRuby, true, "Controls whether the operator supports ruby auto-instrumentation")
Copy link
Contributor

Choose a reason for hiding this comment

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

set to false initially and we can turn it on by default later

@iblancasa
Copy link
Contributor

Please, add the needed documentation to README.md.

Copy link
Contributor

@swiatekm swiatekm left a comment

Choose a reason for hiding this comment

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

I'm blocking this until we have consensus on how we're going to maintain this. Code review can proceed regardless.

Copy link
Contributor

@jaronoff97 jaronoff97 left a comment

Choose a reason for hiding this comment

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

This all looks good to me, I think there's just two things missing:

  1. I think it would be great to add a README into the autoinstrumentation/ruby that describes the agreement the Ruby SIG maintainers have in keeping it up to date, maintaining this etc.
  2. We have a pattern for test e2e-instrumentation apps, and I think it would be great to add one in for ruby, these are usually toy examples that don't do much other than verify that auto-instrumentation is working for the language. I think it would be okay to do this in a followup, but we should make an issue for that either way.

@@ -232,6 +236,30 @@ type Python struct {
Resources corev1.ResourceRequirements `json:"resourceRequirements,omitempty"`
}

type Ruby struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: I think for the future we should probably just make a common struct called "CommonLanguageDetails" or something like that rather than needing to copy-paste this thing everytime. (not asking for that to be done with this, going to convert this comment into an issue)

@@ -0,0 +1,140 @@
# frozen_string_literal: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make that change in the ruby auto-inst prior to merging this?

@xuan-cao-swi
Copy link
Author

We have a pattern for test e2e-instrumentation apps

Thanks @jaronoff97 , I have the e2e instrumentation test case ready. Once this one get accepted/merged, I will create a follow up PR.

Should we make that change in the ruby auto-inst prior to merging this?

I am still working with otel ruby maintainer to push the script as a new ruby gem.

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.

5 participants