Integration to Datadog - logs

Is there any out-of-the-box way to push logs from Gatling to Datadog?

For context, our runs show as successful in Frontline but failed somewhere in some data initialisation steps (before virtual users / RPS starts up).
As the run is successful, there are no logs for us to view.
It’d be very helpful to debug what went wrong by such viewing logs in DataDog.

Does this initialization happen in the constructor of the Simulation? If so, an Exception there would trigger a test failure and the Exception would be reported in the Gatling Enterprise UI.

Yeah, our setup is like:

  • MySim extends Simulation
    • setUp
      • ScenarioBuilder/scenario which has a few .execs to create things by rest/gql (failure is somewhere here)
      • andThen ScenarioBuilder that fires the RPS

For now will debug locally, but will have a look to see if we can more helpfully surface some exceptions. Thank you :+1:

Interesting, thanks for your explanations.

Ideally, what would you like: to be able to abort the test and report an Exception is any error happens in your initialization scenario?

Some more context:
What we had (with ZIO library):

  • wrapping our API calls, catchAll(e => ZIO.succeed(Failure(e.getMessage)))
  • .doIf(_.isFailed)(stopInjector(“stop from the scenario”))

This gives errors like
i.g.c.a.b.SessionHookBuilder$$anon$1 - ‘hook-3’ crashed with ‘z.FiberFailure: Unreachable code after this’, forwarding to the next one

We removed this error catching and stopInjector (hoping to get the exception to bubble to the top), but get the same.


Also tried:

Have the session give a Failure
trying exitHereIf, similar results.

Also:

  setUp(
    thingyCreator(seed).exitHereIfFailed
// thingyCreator returns Gatling Failure

we don’t see the “forwarding to the next one” but the next injectors start and we see RPS logs. i.e. the simulation gets further (but we don’t want it to)


It seems we’re missing some key knowledge on how to go from scenario.exec throwing/returning a Failure, to failing the whole setUp block.

Copying some logs too:

Unreachable code after this13:01:54.314 [ERROR] i.g.c.a.b.SessionHookBuilder$$anon$1 - 'hook-4' failed to execute: Unreachable code after this
13:01:55.822 [ERROR] i.g.c.a.StopInjector - Requested injector to stop: stop from the scenario

================================================================================
2024-04-26 13:01:55                                           3s elapsed
---- Requests ------------------------------------------------------------------
...

Reports generated in 0s.
Please open the following file: ....
[info] Simulation MySim successful.
[info] Simulation(s) execution ended.
[success] Total time: 13 s, completed 26 Apr 2024, 13:01:56

Not sure what’s happening but two errors become a success!