diff --git a/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/_shared/tracing.yml b/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/_shared/tracing.yml new file mode 100644 index 0000000000..d5ac98e730 --- /dev/null +++ b/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/_shared/tracing.yml @@ -0,0 +1,27 @@ +inspectit: + instrumentation: + rules: + + # This rule should be included by all other tracing rules. + # It allows to specify data which is added to all spans as attributes, e.g. a business transaction + 'r_tracing_global_attributes': + include: + 'r_tracing_exception_attributes': true + 'r_tracing_fqn_attribute': true + + # This rule by default only tags the exception name and message (using the toString() method) + # If required, it can be enhanced to include the stack trace. + 'r_tracing_exception_attributes': + 'tracing': + attributes: + 'java.exception': _thrown + + # This rule adds the fully qualified name of the method as span attribute + 'r_tracing_fqn_attribute': + 'tracing': + attributes: + 'java.fqn': 'method_fqn' + entry: + 'method_fqn': + action: 'a_method_getFQN' + diff --git a/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/db/jdbc/tracing.yml b/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/db/jdbc/tracing.yml index dd7cc7b1b0..28f9a56f8c 100644 --- a/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/db/jdbc/tracing.yml +++ b/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/db/jdbc/tracing.yml @@ -38,6 +38,7 @@ inspectit: include: 'r_jdbc_detect_entry': true 'r_jdbc_extract_url': true + 'r_tracing_global_attributes': true tracing: start-span: true start-span-conditions: @@ -45,7 +46,6 @@ inspectit: attributes: 'db.type': 'db_type_sql' 'db.url': 'jdbc_url' - 'java.exception': _thrown error-status: _thrown entry: 'db_type_sql': diff --git a/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/http/_shared/http-tracing.yml b/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/http/_shared/http-tracing.yml index 8d5dd38314..b4562b2d4f 100644 --- a/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/http/_shared/http-tracing.yml +++ b/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/http/_shared/http-tracing.yml @@ -31,6 +31,8 @@ inspectit: # This rule is included by all HTTP Client AND Server tracing rules to define which attributes should be added to the span 'r_http_tracing_default_attributes': + include: + 'r_tracing_global_attributes': true tracing: attributes: 'http.status_code': 'http_status' diff --git a/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/method-tracing.yml b/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/method-tracing.yml index 76c54410fc..6de472314f 100644 --- a/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/method-tracing.yml +++ b/inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/rules/method-tracing.yml @@ -7,13 +7,9 @@ inspectit: # # This rule can be either included or scopes can be directly added to it 'r_trace_method': - 'tracing': + include: + 'r_tracing_global_attributes': true + tracing: start-span: true error-status: _thrown - attributes: - 'java.exception': _thrown - 'java.fqn': 'method_fqn' - entry: - 'method_fqn': - action: 'a_method_getFQN'