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

com.newrelic.agent.attributes.AgentAttributeSender Maven / Gradle / Ivy

There is a newer version: 8.14.0
Show newest version
/*
 *
 *  * Copyright 2020 New Relic Corporation. All rights reserved.
 *  * SPDX-License-Identifier: Apache-2.0
 *
 */

package com.newrelic.agent.attributes;

import com.newrelic.agent.Transaction;

import java.util.Map;

public class AgentAttributeSender extends AttributeSender {
    protected static String ATTRIBUTE_TYPE = "agent";

    public AgentAttributeSender() {
        super(new AttributeValidator(ATTRIBUTE_TYPE));
    }

    @Override
    protected String getAttributeType() {
        return ATTRIBUTE_TYPE;
    }

    @Override
    protected Map getAttributeMap() {
        Transaction currentTxn = Transaction.getTransaction(false);
        if (currentTxn != null) {
            return currentTxn.getAgentAttributes();
        } else {
            return null;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy