-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dynamo client #107
base: master
Are you sure you want to change the base?
dynamo client #107
Conversation
I just noticed that the aws sdk has two useful looking sub packages that might be able to replace the attribute/query building code in this client. |
return gio.Item == nil | ||
} | ||
|
||
func isValidConsumedCapacityLevel(level string) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we care about this?
dynamodb_client/dynamo.go
Outdated
Endpoint: aws.String(params.LocalDynamoURL), | ||
} | ||
svc := dynamodb.New(session.New(), &config) | ||
//svc.Handlers.Retry.PushFrontNamed(CheckThrottleHandler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this?
dynamodb_client/base_table_client.go
Outdated
} | ||
|
||
req, _ := dt.client.PutItemRequest(input) | ||
err := dt.sendWithTracing(ctx, req) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If #109 is merged, then we can just remove all of this and use PutItemWithContext
. To add tracing to the client, with the table name included in the spans:
s := contrib.WithTracing(session.New())
c := dynamodb.New(s)
c.Handlers.Send.PushBack(func(r *request.Request) {
span := opentracing.SpanFromContext(r.Context())
span.SetTag(dd_opentracing.SpanType, "db")
span.SetTag("aws.table_name", dt.tableName)
})
I rebased this, and added two commits:
|
Changing to "WIP". If you would like this to be reviewed, please convert back from WIP and we'll take a look. |
This is a pretty simple dynamodb client that supports apm tracing and takes an an input a map of table descriptions (to be used in testing and in production for table creation).