Skip to content

X-Ray for a lambda function on Golang #2074

Answered by RanVaknin
jledesma-opsguru asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @jledesma-opsguru ,

The Xray client offered by aws-sdk-go-v2 is for managing debug traces and retrieving service maps and other data created by processing those traces.

If you are trying to create traces for different clients used by your application, you need to use the Xray SDK.
Seeing your code, you are trying to instrument your calls using the syntax for v1 instrumentation.

To instrument go sdk v2 calls youll need to use different syntax. Here is a snippet from their official docs:

package main

import (
	"context"
	"log"

	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/config"
	"github.com/aws/aws-sdk-go-v2/service/dynamodb"
	"github.com/aws/aws-xray-sdk-go/inst…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by RanVaknin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
2 participants