Skip to content

Update nocode instrumentation#2294

Merged
laurit merged 3 commits intosignalfx:mainfrom
laurit:nocode-update
Apr 30, 2025
Merged

Update nocode instrumentation#2294
laurit merged 3 commits intosignalfx:mainfrom
laurit:nocode-update

Conversation

@laurit
Copy link
Copy Markdown
Collaborator

@laurit laurit commented Apr 25, 2025

Bring over some of the changes made during the upstreaming attempt. cc @johnbley

@laurit laurit requested review from a team as code owners April 25, 2025 10:50
Copy link
Copy Markdown
Contributor

@johnbley johnbley left a comment

Choose a reason for hiding this comment

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

Thanks so much for this! Sometime soon I'll take a stab at using the new ruleId capability to add more class/method selectors (inherits-from, regex on name, etc.)


returnValue =
AsyncOperationEndSupport.create(instrumenter(), Object.class, method.getReturnType())
.asyncEnd(context, otelInvocation, returnValue, error);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very happy about this!

spanStatusBuilder.setStatus(StatusCode.ERROR);
}
if (mi.getRule() == null || mi.getRule().getSpanStatus() == null) {
SpanStatusExtractor.getDefault().extract(spanStatusBuilder, mi, returnValue, error);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

😄

public static class NocodeAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)
public static void onEnter(
@RuleId int ruleId,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎉 !

Comment on lines +40 to +42
Map<String, NocodeExpression> attributes = mi.getRuleAttributes();
for (String key : attributes.keySet()) {
String expression = attributes.get(key);
Object value = NocodeEvaluation.evaluate(expression, mi.getThiz(), mi.getParameters());
NocodeExpression expression = attributes.get(key);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't feel super duper strongly about this, but anytime I see iteration over keyset where the first line of the loop is map.get(key) I feel like it just wants to be iterating over the map.entrySet() instead.

Copy link
Copy Markdown
Contributor

@breedx-splk breedx-splk left a comment

Choose a reason for hiding this comment

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

Had a couple small comments, but seems like progress. 🚀

@laurit laurit enabled auto-merge (squash) April 30, 2025 12:57
@laurit laurit merged commit 84c549c into signalfx:main Apr 30, 2025
26 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 30, 2025
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.

3 participants