-
Notifications
You must be signed in to change notification settings - Fork 12
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
Update GetSessionToken error logging #127
Conversation
_, err := c.writerService() | ||
if err != nil { | ||
return nil, err | ||
if c.tokenRoleWriter != "" { |
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.
failing early if the writer role is not configured
@@ -534,31 +534,26 @@ func (c *twinMakerClient) GetSessionToken(ctx context.Context, duration time.Dur | |||
} | |||
|
|||
func (c *twinMakerClient) GetWriteSessionToken(ctx context.Context, duration time.Duration, workspaceId string) (*sts.Credentials, error) { | |||
_, err := c.writerService() |
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.
is this writerService
call needed? it seems like GetWriteSessionToken
handles assuming the role
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.
I don't think. This was just mirroring the other getsession function really.
// Print the error, cast err to awserr.Error to get the Code and | ||
// Message from an error. | ||
fmt.Println(err.Error()) | ||
log.DefaultLogger.Error("error getting session token", "code", aerr.Code(), "error", aerr) |
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.
@haweston i updated this to use the grafana plugin SDK logger. it seems like having the code might be useful info in all cases where the info is available, so i added a code
field
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.
Okay, yeah that's definitely better.
No description provided.