-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
workload/schemachange: export OTLP traces #113959
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chrisseto
requested review from
srosenberg and
DarrylWong
and removed request for
a team
November 7, 2023 18:54
chrisseto
changed the title
workload/schemachange: export OTLP traces
workload/schemachange: export OTLP traces
Nov 7, 2023
Prior to this change, `QueryLoad.Close` would not be called if a workload worker returned an error. This callback is often used to perform cleanup or flush log files; actions which are even more important to perform in the case of an error. This commit hoists the execution of `Close` into a `defer` to ensure they're appropriately called in all reasonable exit scenarios. It also relocates the `schemachange` workload's usage of `PostRun` to `QueryLoad.Close`. Epic: CRDB-19168 Release note (cli change): workload commands now appropriately invoke `.Close` in the case of an error.
The majority of fields on a `pgx.ConnConfig` can be set or influenced via the connection URL. An unfortunate exception to this case is the `QueryTracer` field which allows external users to trace or log outgoing queries. This commit adds a `QueryTracer` field to `MultiConnPoolCfg` which will allow workloads to instrument pgx connections with tracing and logging to aid in debugging failures or understanding other behaviors of a workload. Epic: CRDB-19168 Release note: None
`workload/schemachange` solely relies on a bespoke logging solution for collecting and reporting debug information. While useful, logging alone is limited in the usefulness of the information it can provide without becoming overly noisy. This commit begins the process of bolstering the existing logging solution by adding OTeL instrument to the workload's entrypoint. Future commits will add further instrumentation, logging integration, and a file based exporter. Epic: CRDB-19168 Release note: None
This commit instruments the `MultiConnPool` used in the schemachange workload with OTeL by implementing `pgx.QueryTracer`. Doing so ensures that all queries executed by the workload are logged to spans. Future commits will instrument the workers and query helpers. The combination of all these instrumentations will allow debuggers to easily inspect all SQL queries emitted by the workload and isolate them to individual workers and transactions. Epic: CRDB-19168 Release note: None
Previous commits instrumented the schemachange workload with OTeL but did not provide a way to access the output spans. This commit implements a OTLP exporter to a bespoke tar.gz format. See `OTLPFileClient` for more details about the format and why it was chosen. Epic: none Release note (cli change): workload schemachange now writes a tar.gz archive containing OTLP trace bundles for debugging purposes.
chrisseto
force-pushed
the
rsw-otpl-file
branch
from
November 7, 2023 19:38
cedffc3
to
c9f6ae1
Compare
Hmm, my mistake I did some branch shuffling and accidentally made two version of this. This PR is superseded by #114770 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is stacked on top of others!
Please consider reviewing those PRs first. This message will be removed once prerequisite PRs are merged and this one is rebased.
Close
gets called #113896c9f6ae1 workload/schemachange: export OTLP traces
Previous commits instrumented the schemachange workload with OTeL but
did not provide a way to access the output spans.
This commit implements a OTLP exporter to a bespoke tar.gz format. See
OTLPFileClient
for more details about the format and why it waschosen.
Epic: none
Release note (cli change): workload schemachange now writes a tar.gz
archive containing OTLP trace bundles for debugging purposes.