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

[Feature request] Support instrumentation of akka typed actors #679

Closed
kpritam opened this issue Dec 18, 2019 · 10 comments
Closed

[Feature request] Support instrumentation of akka typed actors #679

kpritam opened this issue Dec 18, 2019 · 10 comments

Comments

@kpritam
Copy link

kpritam commented Dec 18, 2019

From akka 2.6.x, akka typed actors APIs are marked as stable.
It would be really nice to provide support for typed actors.

@arunkpatra
Copy link

Any plans on proceeding with this feature request?

@ivantopo ivantopo transferred this issue from kamon-io/kamon-akka Mar 29, 2020
@bitbeter
Copy link

Is there any open-tracing solution for akka typed ?!

@SimunKaracic
Copy link
Contributor

Can you point me to any specific problems you have with akka-typed actors?
As far as I can tell, they're getting traced correctly, but there's some issues with actor class names and auto-grouping that are fixed in this PR #898 which should be merged soon!

@bitbeter
Copy link

bitbeter commented Nov 20, 2020

@SimunKaracic
Ooo, Maybe I'm wrong
I create simple project with java based akka-typed application (BehaviorAbstract, EventSourced, ...] and i run this command for creating "Jaeger all-in-one" application

docker run -d --name jaeger \
  -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 \
  -p 5775:5775/udp \
  -p 6831:6831/udp \
  -p 6832:6832/udp \
  -p 5778:5778 \
  -p 16686:16686 \
  -p 14268:14268 \
  -p 14250:14250 \
  -p 9411:9411 \
  jaegertracing/all-in-one:1.20

and setup configs to this

kamon {
  jaeger {
    enabled = true
    # Define the host/port where the Jaeger Collector/Agent is listening.
    host = "localhost"
    port = 14268

    # Protocol used to send data to Jaeger. The available options are:
    #   - http: Sends spans using jaeger.thrift over HTTP (collector).
    #   - https: Sends spans using jaeger.thrift over HTTPS (collector).
    #   - udp: Sends spans using jaeger.thrift compact over UDP (agent).
    protocol = HTTP
    # Enable or disable including tags from kamon.environment as labels
     include-environment-tags = no
  }
}
public class Main {
    public static void main(String[] args) {
        Kamon.init();
        ActorSystem.create(MainSystem.create(), MainSystem.NAME);
    }
}

but nothing I saw in Jaeger client at all, i saw just Jaeger query traces of itself.

then I saw this issue, so i was thinking, kamon library may not working for typed, and then i ask the question ...

Any extra thing I forgot to do ?

@SimunKaracic
Copy link
Contributor

SimunKaracic commented Nov 20, 2020

Try adding kamon.trace.sampler = always to the kamon configuration!

If that doesn't work, you can try sharing the code with me so I can try and reproduce it!
I've been using the akka quickstart example to try the tracing out

@SimunKaracic
Copy link
Contributor

Also, actors won't start spans by themselves, they'll merely be part of the trace.
Checkout this answer (the Kamon.runWithSpan part is what you might need) if you don't have any http calls or something else that will start a trace
#896 (comment)

@n3ziniuka5
Copy link

Can you point me to any specific problems you have with akka-typed actors?

Current examples in the documentation show context propagation with classic actors and they don't mention anything about akka-typed. So, does context propagation actually work with akka-typed? If so, how does it pass the context?

@SimunKaracic
Copy link
Contributor

Typed actors get transformed into untyped actors of class ActorAdapter, and they (both typed and untyped actors) run on the same ActorSystem. A great side benefit of that (for us) is that we don't have to change anything for tracing and context propagation, since the underlying mechanisms/runtime are the same whether you use typed or untyped actors.

... examples in the documentation ...

Are you refering to this page? https://kamon.io/docs/latest/instrumentation/akka/context-propagation/
If so, all of that works exactly the same for typed actors.
Besides some of the tag changes (in the PR linked above), there's nothing really new that need to be done.

If you have a specific example, let me know, we want typed actors to have the same coverage as classic ones

@n3ziniuka5
Copy link

Are you refering to this page? https://kamon.io/docs/latest/instrumentation/akka/context-propagation/
If so, all of that works exactly the same for typed actors.
Besides some of the tag changes (in the PR linked above), there's nothing really new that need to be done.

If you have a specific example, let me know, we want typed actors to have the same coverage as classic ones

Yes, I was referring to that page. I think even if examples are with classic actors, it would be good to list akka-typed support as an explicit feature in the documentation. I doubt I was the only one who got the impression that Kamon only supports untyped actors.

Apart from that, I don't have a concrete example of something that's not working in akka-typed and am looking forward to start using Kamon in akka-typed systems now. Thanks!

@SimunKaracic
Copy link
Contributor

We're updating the documentation to show a akka-typed example!
I'm closing this, if you see any problems with akka-typed please open an issue!

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

No branches or pull requests

5 participants