Skip to content

Phobos instrumentation settings for actor props get overwritten by PhobosActorCell settings #85

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

Closed
object opened this issue Jan 13, 2025 · 5 comments
Labels
actor-integration 📬 Integration with Akka.NET runtime bug Something isn't working configuration 📃 Issues related to HOCON configuration for individual drivers

Comments

@object
Copy link

object commented Jan 13, 2025

I continue struggling with custom actor type name, and I believe this time I hit an issue that may be unrelated to F#.

I debug the code that creates an instance of an actor by calling ActorOf on an actor factory. If I debug the code, I reach the following Phobos code:

public override IActorRef ActorOf(Props props, string name = null)
{
return base.ActorOf(this.InstrumentationSettings.PropagateSettingsToChildren ? props.WithInstrumentation(this.InstrumentationSettings) : props, name);
}

The custom actor type name is inside "props" data that are sent to the method ActorOf. But the flag PropagateSettingsToChildren on the instance of PhobosActorCell is set to "true", so instead of using the "props" data that are sent to the method it uses data that belong to this.InstrumentationSettings, and there ActorTypeName is set to "null". So whatever I send gets overwritten by the InstrumentationSettings of the PhobosActorCell.

I never set the flag PropagateSettingsToChildren.

So how should I trigger usage of setting from my props, and not the PhobosActorCell?

@Aaronontheweb Aaronontheweb added bug Something isn't working actor-integration 📬 Integration with Akka.NET runtime configuration 📃 Issues related to HOCON configuration for individual drivers labels Jan 14, 2025
@Aaronontheweb
Copy link
Member

On it - not sure if this will make it into v2.7.1 (since that's needed urgently per akkadotnet/akka.net#7467 ) but we were already planning on doing a 2.7.2 release shortly thereafter. I'll see if I can include this in 2.7.2.

@Aaronontheweb
Copy link
Member

Have this issue fixed in a PR, along with some convenience methods that make it somewhat easier to configure too. Letting CI/CD do it's thing and then I'll try to get a release prepared this evening.

@object
Copy link
Author

object commented Jan 16, 2025

Is there anything changed on a client side to configure instrumentation?

@Aaronontheweb
Copy link
Member

@object I've added a convenience method that makes it easier to specify a custom actor name:

// where Sys == ActorSystem
Props.Create(() => new EntityActor(magicString))
                        .WithInstrumentation(Sys, settings => settings.WithActorTypeName("Foober")

But other than that - no! Everything still works the same. And I added a reproduction spec to make sure this works with Cluster.Sharding too. I'm typing up the Phobos 2.8.0 release notes now and I'll push this to Sdkbin shortly.

@object
Copy link
Author

object commented Jan 16, 2025

Great! I'll try it tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actor-integration 📬 Integration with Akka.NET runtime bug Something isn't working configuration 📃 Issues related to HOCON configuration for individual drivers
Projects
None yet
Development

No branches or pull requests

2 participants