Skip to content

Conversation

@kirs
Copy link
Contributor

@kirs kirs commented Aug 29, 2025

In apps that use advanced exception tracking, having raw Trilogy error on the span can be misleading because it's likely handled by ActiveRecord. Surfacing it as an actual exception introduces some misdirection here.

I'd like to suggest that we make this behaviour configurable via record_exception option. It would be set to true by default, preserving existing behaviour.

@robertlaurin @fbogsany

Copy link
Contributor

@ericmustin ericmustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, happy to approve , We have some prior patterns like this in other instrumentation(ie rack/rails), and this seems like a useful knob to make the instrumentation more flexible. I am not an active trilogy user at this time so I defer to the folks working with that gem daily.

@connection_options = options # This is normally done by Trilogy#initialize

tracer.in_span(
in_span(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fbogsany suggested we improve the in_span convenience method to allow for the desired behaviour so all that is required in the PR is to update the calls to in span.

Related: open-telemetry/opentelemetry-ruby#1911

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kirs - what do you think about updating this PR to use the changes to the in_span method from open-telemetry/opentelemetry-ruby#1911?

@robertlaurin
Copy link
Contributor

@kirs sorry for the slow turnaround but if you update the gemspec dependency of the opentelemetry-api to 1.7.0 you can make use of the kwarg added in open-telemetry/opentelemetry-ruby#1911

@kirs kirs force-pushed the trilogy-record_exception-setting branch from 05258be to be696db Compare September 24, 2025 00:49
@fbogsany fbogsany changed the title Trilogy: introduce record_exception setting feat: Trilogy: introduce record_exception setting Sep 24, 2025
@kirs kirs force-pushed the trilogy-record_exception-setting branch from 0f59835 to 604e35d Compare September 24, 2025 18:05
@robertlaurin robertlaurin merged commit b807e59 into open-telemetry:main Sep 25, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants