Splunk AppDynamics

golang sdk

Tatiane_Nicchet
New Member

Hi,

I am new to the community and I am having a few problems to use appdynamics with golang. I followed the tutorial and succefully connected my GO application with the SDK, but I still have a few questions. First of all, do I need to manually insert a business transaction to every external call i wish to observe? For example:

func (c userRepository) getAll()  {
appd.AddBackend("backTest", "DB", map[string]string{"DATABASE": "mongodb",}, false)
btHandle := appd.StartBT("database 1", "")
ecHandle := appd.StartExitcall(btHandle, "backTest")

// calling database

if err != nil {
appd.AddBTError(btHandle, appd.ErrorLevel(2), "error message", true)
} appd.EndExitcall(ecHandle)
appd.EndBT(btHandle)

return ...
}

func (c userRepository) getById() {
appd.AddBackend("backTest", "DB", map[string]string{"DATABASE": "mongodb",}, false)
btHandle := appd.StartBT("database 1", "")
ecHandle := appd.StartExitcall(btHandle, "backTest")

// calling database again
if err != nil {
appd.AddBTError(btHandle, appd.ErrorLevel(2), "another error message", true)
} appd.EndExitcall(ecHandle)
appd.EndBT(btHandle)

return ...
}

 And should I do it manually for every external call that i make? (external API, Database, ....) I find it too time consuming  it and makes the code longer and more difficult to read. Can anyone tell me if I am using the SDK properly or if there is something that i am missing and could make it simpler?

0 Karma

zhouyaoji
Path Finder

Hi Tatiane,

I took a look at the latest docs https://docs.appdynamics.com/appd/23.x/latest/en/application-monitoring/install-app-server-agents/go... and didn't see any different between it and the 4.5.x version, so I'm going to follow up with the writer of the doc to contact the Go SDK engineers to take a look at your example and help answer your questions. Thanks for your post and hope to get you some answers soon.

0 Karma

iamryan
Community Manager
Community Manager

Hi @Tatiane.Nicchetti,

Can you share the link to the tutorial you followed? 

0 Karma

Tatiane_Nicchet
New Member

Hi,

I followed this tutorial to initialize the Agent and the Controller Configuration (https://docs.appdynamics.com/appd/4.5.x/en/application-monitoring/install-app-server-agents/go-langu...).

I have a question about configuring the BTs and Backends. Our company's other applications are already in the appdynamics environment (all in Node or Java) and we need to add this Golang api to monitor all of them together in the dashboard. If I initialize the agent and controllers, will we see all of them working together? Or do we need to set up all calls to backends like i did in the example even if those backends that are already being monitored in the dashboard?

0 Karma
Get Updates on the Splunk Community!

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...

AppDynamics is now part of Splunk Ideas

Hello Splunkers, We have exciting news for you! AppDynamics has been added to the Splunk Ideas Portal. Which ...

Advanced Splunk Data Management Strategies

Join us on Wednesday, May 14, 2025, at 11 AM PDT / 2 PM EDT for an exclusive Tech Talk that delves into ...