Search in sources :

Example 1 with JacksonPayloadSerializer

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);
}
Also used : AfterburnerModule(com.fasterxml.jackson.module.afterburner.AfterburnerModule) OkHttpClient(okhttp3.OkHttpClient) SystemInfo(co.elastic.apm.impl.payload.SystemInfo) JacksonPayloadSerializer(co.elastic.apm.report.serialize.JacksonPayloadSerializer) ConfigurationRegistry(org.stagemonitor.configuration.ConfigurationRegistry) Service(co.elastic.apm.impl.payload.Service) ProcessInfo(co.elastic.apm.impl.payload.ProcessInfo) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with JacksonPayloadSerializer

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);
}
Also used : AfterburnerModule(com.fasterxml.jackson.module.afterburner.AfterburnerModule) ServiceFactory(co.elastic.apm.impl.payload.ServiceFactory) JacksonPayloadSerializer(co.elastic.apm.report.serialize.JacksonPayloadSerializer) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 3 with JacksonPayloadSerializer

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);
}
Also used : AfterburnerModule(com.fasterxml.jackson.module.afterburner.AfterburnerModule) JacksonPayloadSerializer(co.elastic.apm.report.serialize.JacksonPayloadSerializer) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

JacksonPayloadSerializer (co.elastic.apm.report.serialize.JacksonPayloadSerializer)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 AfterburnerModule (com.fasterxml.jackson.module.afterburner.AfterburnerModule)3 ProcessInfo (co.elastic.apm.impl.payload.ProcessInfo)1 Service (co.elastic.apm.impl.payload.Service)1 ServiceFactory (co.elastic.apm.impl.payload.ServiceFactory)1 SystemInfo (co.elastic.apm.impl.payload.SystemInfo)1 OkHttpClient (okhttp3.OkHttpClient)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 ConfigurationRegistry (org.stagemonitor.configuration.ConfigurationRegistry)1