Skip to content
Manpreet edited this page Jan 28, 2023 · 3 revisions
How do I figure out if the data is being posted successfully?

If you are using the RESTPayloadHandler or the GRPCPayloadHandler and see response code 200 or gRPC message export succeeded message in the logs, that means data posting is successful.

I see "Execution stopped due to timeout" in the logs. Is something wrong?

If you see a message like the following in the logs:
<X> of <TOTAL> <METRICS/EVENTS/TRACES> payloads posted. <Y%> of the expected total time elapsed. Execution stopped due to timeout.
It means that one or more of the data posting threads has crashed and the generator had to forcefully stop the data posting service(s) since all the payloads were not posted in the set expected amount of time. Since the data generation threads are running via the ExecutorService, we are unable to see the error that happened and to avoid this situation, it has been built to do deep checks on the input files to fail at validation stage before starting the data generation. Therefore, this should not happen and we'd like you to open an issue with your input definition files and the logs/generator.log file so we can debug what maybe going wrong.

I want to modify the HTTP headers for data posting

There can be cases where you want to change the headers being sent with each request. To handle this, both the RESTPayloadHandler as well as the GRPCPayloadHandler expose the following method:
String[] getHeadersPostData()
You can extend these classes, and override this method to send custom headers.

I want to run the generator in a separate thread and kill it when I like. Is that possible?

The first part can be easily achieved by writing an implementation of Runnable, calling the generator in the run() method and making the data generator object accessible from the class. Once you have the generator object, it can be killed as follows:
telemetryGenerator.getGeneratorsMonitor().killGenerator();
This will immediately & cleanly shutdown all the executor services which are managing the data posting threads.