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

Per-service fx-ified OTEL tracing #2896

Merged
merged 27 commits into from
Jun 22, 2022
Merged

Per-service fx-ified OTEL tracing #2896

merged 27 commits into from
Jun 22, 2022

Conversation

mmcshane
Copy link
Contributor

@mmcshane mmcshane commented May 24, 2022

What changed?
Configures OTEL tracing from configuration YAML and injects into the main 4 services (frontend, history, matching, worker)

Why?
Providing TracerProvider/Tracer instances to key types allows us to create and export spans, thereby improving runtime observability.

How did you test it?
Existing and new unit tests. If the fx changes are broken then the server will refuse to come up.
Also manual testing with a local otelcol

Potential risks
Low risk - If you don't have an otel stanza in your config yaml to set up some exporters file then nothing is going to run.

Is hotfix candidate?
No

@mmcshane mmcshane requested a review from jbreiding May 24, 2022 20:08
@mmcshane mmcshane changed the title WIP per-service fx-ified OTEL tracing Per-service fx-ified OTEL tracing Jun 5, 2022
@mmcshane mmcshane marked this pull request as ready for review June 5, 2022 16:09
@mmcshane mmcshane requested a review from a team as a code owner June 5, 2022 16:09
common/telemetry/config.go Outdated Show resolved Hide resolved
config/development-cass.yaml Outdated Show resolved Hide resolved
common/telemetry/config.go Outdated Show resolved Hide resolved
versionHeadersInterceptor,
metrics.NewClientMetricsTrailerPropagatorInterceptor(logger),
errorInterceptor,
append(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the order important here?
If so we should probably leave a comment as such.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's sort of a bigger problem in that we have some interceptors that are hard-coded to exist and another set that comes from runtime parameters so if there was some sort of important ordering dependency then it would be difficult to resolve.

That said, in this case where I happen to know that the interceptor slice contains just the trace interceptor (or is empty) then the order isn't all that imporant.

@@ -28,3 +28,5 @@
# Fossa
.fossa.yml

# direnv
.envrc
Copy link
Member

Choose a reason for hiding this comment

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

just fyi, my strategy is to put an .envrc in the directory above this repo, so I can share it with the other temporal repos too

Matt McShane added 23 commits June 21, 2022 13:11
Removes the serviceName parameter from the ServiceTrackingModule
function (now just a var) as that piece of data can be read from the DI
container as a dependency.

Also inits the OTEL error logger to delegate to the server's Zap logger.
Host and process attributes can be auto-detected.
Do this so that we can make the ClientConn dialing lazy (i.e. occurs at
when Start() is called on the exporter) because (a) that's preferrable
anyway and (b) easier to unit test when construction and execution
phases are separate.
Made valueOrDefault more general and renamed to coalesce
Matt McShane added 2 commits June 21, 2022 13:11
Avoid possible confusion with temporal sdk
go.mod Outdated Show resolved Hide resolved
host/onebox.go Outdated Show resolved Hide resolved
Matt McShane added 2 commits June 22, 2022 11:58
Avoids potential naming confusion with Temporal SDK related packages.
@mmcshane mmcshane merged commit f86b8d2 into temporalio:master Jun 22, 2022
@mmcshane mmcshane deleted the mpm/tracing branch June 22, 2022 21:03
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.

None yet

4 participants