Skip to content

Commit

Permalink
Add databse type to files repo spans
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinbarbour committed Mar 12, 2024
1 parent fd35e8a commit 2c39cba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/files/repo_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type sqlRepository struct {
func (r *sqlRepository) Record(ctx context.Context, file AcceptedFile) error {
ctx, span := telemetry.StartSpan(ctx, "files-record", trace.WithAttributes(
attribute.String("achgateway.file_id", file.FileID),
attribute.String("achgateway.database", "mysql"),
))
defer span.End()

Expand All @@ -58,6 +59,7 @@ func (r *sqlRepository) Record(ctx context.Context, file AcceptedFile) error {
func (r *sqlRepository) Cancel(ctx context.Context, fileID string) error {
ctx, span := telemetry.StartSpan(ctx, "files-cancel", trace.WithAttributes(
attribute.String("achgateway.file_id", fileID),
attribute.String("achgateway.database", "mysql"),
))
defer span.End()

Expand All @@ -81,6 +83,7 @@ type spannerRepository struct {
func (r *spannerRepository) Record(ctx context.Context, file AcceptedFile) error {
ctx, span := telemetry.StartSpan(ctx, "files-record", trace.WithAttributes(
attribute.String("achgateway.file_id", file.FileID),
attribute.String("achgateway.database", "spanner"),
))
defer span.End()

Expand All @@ -98,6 +101,7 @@ func (r *spannerRepository) Record(ctx context.Context, file AcceptedFile) error
func (r *spannerRepository) Cancel(ctx context.Context, fileID string) error {
ctx, span := telemetry.StartSpan(ctx, "files-cancel", trace.WithAttributes(
attribute.String("achgateway.file_id", fileID),
attribute.String("achgateway.database", "spanner"),
))
defer span.End()

Expand Down

0 comments on commit 2c39cba

Please sign in to comment.