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

Closes #746 - Added extension point for globally adding trace attributes #747

Merged
merged 2 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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':
enabled: true #default setting, but ensures that the rule exists.

# This rule can be extended to tag the stack-trace if required
'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'

Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ inspectit:
include:
'r_jdbc_detect_entry': true
'r_jdbc_extract_url': true
'r_tracing_global_attributes': true
'r_tracing_exception_attributes': true
tracing:
start-span: true
start-span-conditions:
only-if-true: 'jdbc_is_entry'
attributes:
'db.type': 'db_type_sql'
'db.url': 'jdbc_url'
'java.exception': _thrown
error-status: _thrown
entry:
'db_type_sql':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ 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
'r_tracing_exception_attributes': true
'r_tracing_fqn_attribute': true
tracing:
start-span: true
error-status: _thrown
attributes:
'java.exception': _thrown
'java.fqn': 'method_fqn'
entry:
'method_fqn':
action: 'a_method_getFQN'