Skip to content

Commit

Permalink
change test name and suite
Browse files Browse the repository at this point in the history
  • Loading branch information
jirikuncar committed Nov 10, 2020
1 parent 2b33934 commit 4bc4d9e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/ddtrace/contrib/rspec/example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ def run(example_group_instance, reporter)
configuration = Datadog.configuration[:rspec]
return super unless configuration[:enabled]

test_name = "#{example_group.description}::#{description}"
trace_options = {
app: Ext::APP,
resource: "#{example_group}::#{description}",
resource: test_name,
service: configuration[:service_name],
span_type: Datadog::Ext::AppTypes::TEST,
tags: example_group.instance_variable_get(:@tags).merge(Datadog.configuration.tags)
}

configuration[:tracer].trace(configuration[:operation_name], trace_options) do |span|
span.set_tag(Datadog::Ext::Test::TAG_FRAMEWORK, Ext::FRAMEWORK)
span.set_tag(Datadog::Ext::Test::TAG_NAME, description)
span.set_tag(Datadog::Ext::Test::TAG_SUITE, example_group)
span.set_tag(Datadog::Ext::Test::TAG_NAME, test_name)
span.set_tag(Datadog::Ext::Test::TAG_SUITE, example_group.file_path)
span.set_tag(Datadog::Ext::Test::TAG_TYPE, Ext::TEST_TYPE)
span.set_tag(Datadog::Ext::Test::TAG_SPAN_KIND, Datadog::Ext::AppTypes::TEST)

Expand Down

0 comments on commit 4bc4d9e

Please sign in to comment.