All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.newrelic.opentracing.events.Event Maven / Gradle / Ivy

Go to download

New Relic OpenTracing Tracer implementation for instrumenting AWS Lambda functions.

The newest version!
/*
 * Copyright 2020 New Relic Corporation. All rights reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

package com.newrelic.opentracing.events;

import org.json.simple.JSONArray;
import org.json.simple.JSONAware;

import java.util.Arrays;
import java.util.Map;

public abstract class Event implements JSONAware {

    public abstract Map getIntrinsics();

    public abstract Map getUserAttributes();

    public abstract Map getAgentAttributes();

    /**
     * Print an event according to the following data format: an array of 3 hashes representing intrinsics,
     * user attributes, and agent attributes.
     */
    @Override
    public String toString() {
        return toJSONString();
    }

    @Override
    public String toJSONString() {
        return JSONArray.toJSONString(Arrays.asList(getIntrinsics(), getUserAttributes(), getAgentAttributes()));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy