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

Config removing detailed spans #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Artur-Sulej
Copy link

@Artur-Sulej Artur-Sulej commented Feb 28, 2024

This PR adds configuration flag emit_detailed_spans passed to SpandexEcto.EctoLogger.
This flag can be set either in application config:

config :spandex_ecto, SpandexEcto.EctoLogger, tracer: MyApp.Tracer, emit_detailed_spans: false

Or via the config argument in :telemetry.attach/4

:telemetry.attach(&SpandexEcto.TelemetryAdapter.handle_event/4,
  emit_detailed_spans: false
)

This config is later passed to SpandexEcto.TelemetryAdapter.handle_event/4 (it happens in execute).

Setting emit_detailed_spans: false will result in removing spans queue, run_query and decode, leaving only query span.
The change backward compatible. The default value (when the flag is not set) is true, meaning that the details spans are emitted like without this change.

@Artur-Sulej Artur-Sulej force-pushed the remove-redundant-spans branch 2 times, most recently from 6b84a02 to 2367b70 Compare February 29, 2024 15:45
@Artur-Sulej Artur-Sulej changed the title WIP Config removing detailed spans Feb 29, 2024
@Artur-Sulej Artur-Sulej marked this pull request as ready for review February 29, 2024 16:19
@Artur-Sulej Artur-Sulej force-pushed the remove-redundant-spans branch from 2367b70 to 35eb4a6 Compare February 29, 2024 16:21
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.

1 participant