mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-01-06 08:49:53 -06:00
Fix OTel span attribute naming convention (#2409)
* rename spans according to convention * low cardinality
This commit is contained in:
@@ -13,10 +13,10 @@ import (
|
||||
"github.com/hatchet-dev/hatchet/internal/cache"
|
||||
"github.com/hatchet-dev/hatchet/internal/msgqueue"
|
||||
"github.com/hatchet-dev/hatchet/internal/queueutils"
|
||||
"github.com/hatchet-dev/hatchet/internal/telemetry"
|
||||
"github.com/hatchet-dev/hatchet/pkg/logger"
|
||||
"github.com/hatchet-dev/hatchet/pkg/repository"
|
||||
"github.com/hatchet-dev/hatchet/pkg/repository/postgres/dbsqlc"
|
||||
"github.com/hatchet-dev/hatchet/pkg/telemetry"
|
||||
)
|
||||
|
||||
type PostgresMessageQueue struct {
|
||||
|
||||
@@ -15,9 +15,9 @@ import (
|
||||
"github.com/rs/zerolog"
|
||||
|
||||
"github.com/hatchet-dev/hatchet/internal/msgqueue"
|
||||
"github.com/hatchet-dev/hatchet/internal/telemetry"
|
||||
"github.com/hatchet-dev/hatchet/pkg/logger"
|
||||
"github.com/hatchet-dev/hatchet/pkg/random"
|
||||
"github.com/hatchet-dev/hatchet/pkg/telemetry"
|
||||
)
|
||||
|
||||
const MAX_RETRY_COUNT = 15
|
||||
|
||||
@@ -14,10 +14,10 @@ import (
|
||||
"github.com/hatchet-dev/hatchet/internal/cache"
|
||||
msgqueue "github.com/hatchet-dev/hatchet/internal/msgqueue/v1"
|
||||
"github.com/hatchet-dev/hatchet/internal/queueutils"
|
||||
"github.com/hatchet-dev/hatchet/internal/telemetry"
|
||||
"github.com/hatchet-dev/hatchet/pkg/logger"
|
||||
"github.com/hatchet-dev/hatchet/pkg/repository"
|
||||
"github.com/hatchet-dev/hatchet/pkg/repository/postgres/dbsqlc"
|
||||
"github.com/hatchet-dev/hatchet/pkg/telemetry"
|
||||
)
|
||||
|
||||
type PostgresMessageQueue struct {
|
||||
@@ -111,7 +111,7 @@ func (p *PostgresMessageQueue) SendMessage(ctx context.Context, queue msgqueue.Q
|
||||
ctx, span := telemetry.NewSpan(ctx, "PostgresMessageQueue.SendMessage")
|
||||
defer span.End()
|
||||
|
||||
telemetry.WithAttributes(span, telemetry.AttributeKV{Key: "tenant_id", Value: task.TenantID})
|
||||
telemetry.WithAttributes(span, telemetry.AttributeKV{Key: "tenant.id", Value: task.TenantID})
|
||||
|
||||
err := p.addMessage(ctx, queue, task)
|
||||
|
||||
@@ -128,7 +128,7 @@ func (p *PostgresMessageQueue) addMessage(ctx context.Context, queue msgqueue.Qu
|
||||
ctx, span := telemetry.NewSpan(ctx, "add-message")
|
||||
defer span.End()
|
||||
|
||||
telemetry.WithAttributes(span, telemetry.AttributeKV{Key: "tenant_id", Value: task.TenantID})
|
||||
telemetry.WithAttributes(span, telemetry.AttributeKV{Key: "tenant.id", Value: task.TenantID})
|
||||
|
||||
// inject otel carrier into the message
|
||||
if task.OtelCarrier == nil {
|
||||
|
||||
@@ -17,9 +17,9 @@ import (
|
||||
|
||||
msgqueue "github.com/hatchet-dev/hatchet/internal/msgqueue/v1"
|
||||
"github.com/hatchet-dev/hatchet/internal/queueutils"
|
||||
"github.com/hatchet-dev/hatchet/internal/telemetry"
|
||||
"github.com/hatchet-dev/hatchet/pkg/logger"
|
||||
"github.com/hatchet-dev/hatchet/pkg/random"
|
||||
"github.com/hatchet-dev/hatchet/pkg/telemetry"
|
||||
)
|
||||
|
||||
const MAX_RETRY_COUNT = 15
|
||||
@@ -281,7 +281,7 @@ func (t *MessageQueueImpl) pubMessage(ctx context.Context, q msgqueue.Queue, msg
|
||||
ctx, span := telemetry.NewSpanWithCarrier(ctx, "publish-message", otelCarrier)
|
||||
defer span.End()
|
||||
|
||||
telemetry.WithAttributes(span, telemetry.AttributeKV{Key: "tenant_id", Value: msg.TenantID})
|
||||
telemetry.WithAttributes(span, telemetry.AttributeKV{Key: "tenant.id", Value: msg.TenantID})
|
||||
|
||||
msg.SetOtelCarrier(otelCarrier)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user