Depends on the type of agent (java?, Node?, .NET, host-only,?). But you can generally define the agent name thru a name parameter where you added the agent to your specific technology. Or you can specify the agentname via an OS level environment variable. DT_AGENT_NAME: "dtagent"
If this isn't what you're looking for, please clarify what technology and how you're currently adding the agent.