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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...