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

Custom actor type names are still not used in Phobos 2.6.2 #82

Closed
object opened this issue Dec 23, 2024 · 9 comments
Closed

Custom actor type names are still not used in Phobos 2.6.2 #82

object opened this issue Dec 23, 2024 · 9 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 Dec 23, 2024

I have updated Phobos library to the version 2.6.2 but the Phobos metrics dashboard panels still show type-derived actor names.
Here are examples from "Live actors by type":

  • FunPersistentActor`1
  • FunActor`1

"Actors Starts and Stops by Type":

  • Akkling.Actors.FunActor<Nrk.Oddjob.Core.MessageTypes+AcknowledgementCommand>
  • Akkling.Actors.FunActor
  • Akkling.Persistence.FunPersistentActor

    I think we have two issues here. First is the major one: customized actor type names are not used. The second one is that these two panels use different actor names: "Live actors by type" uses the type name as returned by reflection, "Actors Starts and Stops by Type" uses more delicate approach and expands parameterized types with its arguments, i.e. showing as different actor types actors with different message types. Shouldn't these two panels use the same naming schema?

    I think it might be easier to locate the problem if I create a small subset of our code base that reproduces the error. It will take some time to extract a small code set.

    For the reference, here's the F# code we use to customize actor type names:

        let withActorTypeName actorTypeName (props: Props<_>) =
            let settings =
                Phobos.Actor.Configuration
                    .PhobosActorSettings(false, true)
                    .WithActorTypeName(actorTypeName)
            let deploy =
                match props.Deploy with
                | Some deploy -> deploy.WithInstrumentation(settings)
                | None -> Deploy.Local.WithInstrumentation(settings)
            { props with Deploy = Some deploy }
    
    
@Aaronontheweb
Copy link
Member

Gosh I'm sorry about this @object - I'll integrate an example of this into our test lab today and see if I can reproduce it there

@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 Dec 23, 2024
@object
Copy link
Author

object commented Dec 23, 2024

BTW do you happen to have a docker setup to collect OTel metrics on a local machine with Phobos dashboards, similar to what Steven Cleary had. So I can run our services locally and metrcis would appear on a Graphana in a local container? Should be easy to make one but in case you have everything set up, it would speed up testing.

@Aaronontheweb
Copy link
Member

We pretty much use his setup, but I could make that turnkey - was already planning on fixing https://github.com/petabridge/Petabridge.Phobos.Web today as part of some end-of-year tech debt cleaning

@Aaronontheweb
Copy link
Member

The second one is that these two panels use different actor names: "Live actors by type" uses the type name as returned by reflection, "Actors Starts and Stops by Type" uses more delicate approach and expands parameterized types with its arguments, i.e. showing as different actor types actors with different message types. Shouldn't these two panels use the same naming schema?

Ugh, you're right - this problem stems from how Phobos collects the latter information: it relies on akkadotnet/akka.net#6294, which is an Akka.NET base-level thing. I'd need to add an override inside the ActorCell in Akka.NET to make these values standardized on the custom naming convention. That shouldn't be hard to do but it's going to require a round-trip back to Akka.NET probably.

@object
Copy link
Author

object commented Dec 23, 2024

We pretty much use his setup, but I could make that turnkey - was already planning on fixing https://github.com/petabridge/Petabridge.Phobos.Web today as part of some end-of-year tech debt cleaning

Thanks!

@Aaronontheweb
Copy link
Member

Have a fix into Akka.NET v1.5.33 for the start / stop telemetry names: akkadotnet/akka.net#7434

@Aaronontheweb
Copy link
Member

So the metrics we did fix in v2.6.2 were the actor message processing metrics - those all appear to be working correctly in our local tests, but I overlooked the gauges for tracking things like "live actors by type" - they use different names for the same reason.

Aaronontheweb added a commit to akkadotnet/akka.net that referenced this issue Dec 23, 2024
@Aaronontheweb
Copy link
Member

We've just pushed Phobos 2.7.0 to Sdkbin (it should be live shortly) and I can confirm that this issue is finally resolved @object - thank you for your patience!

Here's a screenshot from our local environment where I made sure we used this feature:

image

Release notes: https://phobos.petabridge.com/articles/releases/RELEASE_NOTES.html

@object
Copy link
Author

object commented Jan 9, 2025

Great, thank you! I will try it in a couple of days.

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