Skip to content

Commit

Permalink
Fix incorrect attribute name for trace.root (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahsivjar committed Aug 6, 2024
1 parent 0c932e7 commit 3a9ee65
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion enrichments/trace/internal/elastic/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
AttributeAgentVersion = "agent.version"

// span attributes
AttributeTransactionRoot = "transaction.root"
AttributeTraceRoot = "trace.root"
AttributeTransactionName = "transaction.name"
AttributeTransactionType = "transaction.type"
AttributeTransactionResult = "transaction.result"
Expand Down
2 changes: 1 addition & 1 deletion enrichments/trace/internal/elastic/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (s *spanEnrichmentContext) enrichTransaction(
cfg config.ElasticTransactionConfig,
) {
if cfg.TraceRoot.Enabled {
span.Attributes().PutBool(AttributeTransactionRoot, isTraceRoot(span))
span.Attributes().PutBool(AttributeTraceRoot, isTraceRoot(span))
}
if cfg.Name.Enabled {
span.Attributes().PutStr(AttributeTransactionName, span.Name())
Expand Down
18 changes: 9 additions & 9 deletions enrichments/trace/internal/elastic/span_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestElasticTransactionEnrich(t *testing.T) {
input: ptrace.NewSpan(),
config: config.Enabled().Transaction,
enrichedAttrs: map[string]any{
AttributeTransactionRoot: true,
AttributeTraceRoot: true,
AttributeTransactionName: "",
AttributeEventOutcome: "success",
AttributeTransactionResult: "Success",
Expand All @@ -65,7 +65,7 @@ func TestElasticTransactionEnrich(t *testing.T) {
}(),
config: config.Enabled().Transaction,
enrichedAttrs: map[string]any{
AttributeTransactionRoot: true,
AttributeTraceRoot: true,
AttributeTransactionName: "testtxn",
AttributeEventOutcome: "success",
AttributeTransactionResult: "HTTP 2xx",
Expand All @@ -87,7 +87,7 @@ func TestElasticTransactionEnrich(t *testing.T) {
}(),
config: config.Enabled().Transaction,
enrichedAttrs: map[string]any{
AttributeTransactionRoot: true,
AttributeTraceRoot: true,
AttributeTransactionName: "testtxn",
AttributeEventOutcome: "success",
AttributeTransactionResult: "HTTP 1xx",
Expand All @@ -108,7 +108,7 @@ func TestElasticTransactionEnrich(t *testing.T) {
}(),
config: config.Enabled().Transaction,
enrichedAttrs: map[string]any{
AttributeTransactionRoot: true,
AttributeTraceRoot: true,
AttributeTransactionName: "testtxn",
AttributeEventOutcome: "success",
AttributeTransactionResult: "HTTP 5xx",
Expand All @@ -130,7 +130,7 @@ func TestElasticTransactionEnrich(t *testing.T) {
}(),
config: config.Enabled().Transaction,
enrichedAttrs: map[string]any{
AttributeTransactionRoot: true,
AttributeTraceRoot: true,
AttributeTransactionName: "testtxn",
AttributeEventOutcome: "success",
AttributeTransactionResult: "OK",
Expand All @@ -152,7 +152,7 @@ func TestElasticTransactionEnrich(t *testing.T) {
}(),
config: config.Enabled().Transaction,
enrichedAttrs: map[string]any{
AttributeTransactionRoot: true,
AttributeTraceRoot: true,
AttributeTransactionName: "testtxn",
AttributeEventOutcome: "success",
AttributeTransactionResult: "Internal",
Expand All @@ -169,7 +169,7 @@ func TestElasticTransactionEnrich(t *testing.T) {
}(),
config: config.Enabled().Transaction,
enrichedAttrs: map[string]any{
AttributeTransactionRoot: true,
AttributeTraceRoot: true,
AttributeTransactionName: "testtxn",
AttributeEventOutcome: "success",
AttributeTransactionResult: "Success",
Expand All @@ -186,7 +186,7 @@ func TestElasticTransactionEnrich(t *testing.T) {
}(),
config: config.Enabled().Transaction,
enrichedAttrs: map[string]any{
AttributeTransactionRoot: true,
AttributeTraceRoot: true,
AttributeTransactionName: "testtxn",
AttributeEventOutcome: "failure",
AttributeTransactionResult: "Error",
Expand All @@ -203,7 +203,7 @@ func TestElasticTransactionEnrich(t *testing.T) {
}(),
config: config.Enabled().Transaction,
enrichedAttrs: map[string]any{
AttributeTransactionRoot: true,
AttributeTraceRoot: true,
AttributeTransactionName: "testtxn",
AttributeEventOutcome: "success",
AttributeTransactionResult: "Success",
Expand Down

0 comments on commit 3a9ee65

Please sign in to comment.