use of co.elastic.apm.report.serialize.JacksonPayloadSerializer in project apm-agent-java by elastic.
the class ApmServerReporterIntegrationTest method setUp.
@BeforeEach
void setUp() {
handler = exchange -> {
receivedHttpRequests.incrementAndGet();
exchange.setStatusCode(200).endExchange();
};
receivedHttpRequests.set(0);
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new AfterburnerModule());
final ConfigurationRegistry config = SpyConfiguration.createSpyConfig();
reporterConfiguration = config.getConfig(ReporterConfiguration.class);
when(reporterConfiguration.getFlushInterval()).thenReturn(-1);
when(reporterConfiguration.getServerUrl()).thenReturn("http://localhost:" + port);
payloadSender = new ApmServerHttpPayloadSender(new OkHttpClient(), new JacksonPayloadSerializer(objectMapper), reporterConfiguration);
SystemInfo system = new SystemInfo("x64", "localhost", "platform");
reporter = new ApmServerReporter(config, new Service(), new ProcessInfo("title"), system, payloadSender, false, reporterConfiguration);
}
use of co.elastic.apm.report.serialize.JacksonPayloadSerializer in project apm-agent-java by elastic.
the class ReporterFactory method createReporter.
public Reporter createReporter(ConfigurationRegistry configurationRegistry, @Nullable String frameworkName, @Nullable String frameworkVersion) {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new AfterburnerModule());
final ReporterConfiguration reporterConfiguration = configurationRegistry.getConfig(ReporterConfiguration.class);
return new ApmServerReporter(configurationRegistry, new ServiceFactory().createService(configurationRegistry.getConfig(CoreConfiguration.class), frameworkName, frameworkVersion), ProcessFactory.ForCurrentVM.INSTANCE.getProcessInformation(), SystemInfo.create(), new ApmServerHttpPayloadSender(getOkHttpClient(reporterConfiguration), new JacksonPayloadSerializer(objectMapper), reporterConfiguration), true, reporterConfiguration);
}
use of co.elastic.apm.report.serialize.JacksonPayloadSerializer in project apm-agent-java by elastic.
the class AbstractHttpJacksonReporterBenchmark method getPayloadSerializer.
@Override
protected PayloadSerializer getPayloadSerializer() {
ObjectMapper objectMapper = getObjectMapper();
objectMapper.registerModule(new AfterburnerModule());
return new JacksonPayloadSerializer(objectMapper);
}
Aggregations