Skip to content

Nocode prototype#2184

Merged
laurit merged 65 commits intosignalfx:mainfrom
johnbley:nocode_prototype
Feb 21, 2025
Merged

Nocode prototype#2184
laurit merged 65 commits intosignalfx:mainfrom
johnbley:nocode_prototype

Conversation

@johnbley
Copy link
Copy Markdown
Contributor

@johnbley johnbley commented Feb 13, 2025

This adds the ability to define
SPLUNK_OTEL_INSTRUMENTATION_NOCODE_YML_FILE=/path/to/some.yml
Where the yml looks like

- class: foo.Foo
  method: foo
  spanName: this.getName()
  attributes:
    - key: "business.context"
      value: this.getDetails().get("context")

- class: foo.Foo
  method: throwSomething
  spanKind: SERVER
  attributes:
    - key: "tostring"
      value: "this.toString()"

And then applies instrumentation to the given methods to create a span around them, with the given name/kind/attributes.

(If this environment variable is not defined, there is no impact/change to the agent in any way).

It borrows heavily from the existing "methods" instrumentation in upstream and could in theory be upstreamed as such, perhaps in reaction to requests like wanting to name the span.

It wound up being fairly easy to throw together - most of the code is pretty straightforward and the Instrumentation implementation is able to reuse/adhere to a lot of existing infrastructure for plugging in config-provided elements. I augmented the instrumentation tests with more thorough unit testing of the JSPS expression "parser".

One large design topic to be explored is whether to continue using the "JSPS" Java-like expression interpreter or to "buy" an off-the-shelf library for such a thing. This would be a future decision and merging this prototype shouldn't be gated on it - it should be easy enough to swap out that component without touching the rest of the code.

Bikeshedding of all chosen names is welcome!

@johnbley johnbley requested review from a team as code owners February 13, 2025 16:54
@johnbley
Copy link
Copy Markdown
Contributor Author

It's a great start for sure! It's still wild to me that folks have asked for this stuff, but here we are. Nice work turning this around so quickly. 😎

Thanks for your careful read! It's in much better shape and there were quite a few "this is messy but I'll come back to it later" bits that I had missed.

@laurit laurit merged commit fccaa00 into signalfx:main Feb 21, 2025
26 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 21, 2025
@johnbley johnbley deleted the nocode_prototype branch February 21, 2025 14:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants