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

Telemetry/activity not linked back through Observers #9053

Closed
onionhammer opened this issue Jul 3, 2024 · 6 comments · Fixed by #9054
Closed

Telemetry/activity not linked back through Observers #9053

onionhammer opened this issue Jul 3, 2024 · 6 comments · Fixed by #9054

Comments

@onionhammer
Copy link
Contributor

onionhammer commented Jul 3, 2024

When using observers, activities are not linked back to their enclosing observer activity. Not sure if this is a bug or enhancement idea

Per @ReubenBond: The issue is that grain call filters don't run on incoming observer calls

Example:

class MyGrain() : Grain, IMyGrain, IMyGrainObserver
{
    public async Task StartProcessingAThing() // from: IMyGrain
    {
        var reference = this.AsReference<IMyGrainObserver>();

        var processor = GrainFactory.GetGrain<IMyProcessorGrain>(0);

        await processor.StartAndSubscribeAsync(reference);
    }

    public async Task OnProcessedAsync() // from: IMyGrainObserver
    {
        // No longer linked to any activity
    }
}

where the 'processor' would do some job then invoke the observer when complete

@ReubenBond
Copy link
Member

@onionhammer are you using the nightly build? Your repro shows 8.1.0

@onionhammer
Copy link
Contributor Author

Ah I switched to nightly - I was using a custom build before, let me keep experimenting

@ReubenBond
Copy link
Member

ReubenBond commented Jul 8, 2024

image
Your trace above also appears to be correct, since you're calling an observer method on a grain, not an external object reference (which is what my PR adds support for). The last line in your trace appears to be ReceiveMessageAsync call

@onionhammer
Copy link
Contributor Author

onionhammer commented Jul 8, 2024

Crap, I think you're right - the discrepancy I'm seeing is actually related to Aspire's traces not handling links (where app insights does), so it's not an Orleans issue at all.

@ReubenBond
Copy link
Member

I'll close this, then. We got a feature out of it anyway: observer calls on the client now emit traces and support incoming grain call filters :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants