Skip to content
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

Fix incorrect attribute name for trace.root #69

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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