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

api: Adding Zipkin Tracing support #3630

Merged
merged 16 commits into from
Jun 24, 2024

Conversation

alexandermarston
Copy link
Contributor

What type of PR is this?
API to support Zipkin provider for Tracing telemetry.

What this PR does / why we need it:
At present, Envoy Gateway only supports the OpenTelemetry tracing provider.

This PR updates the underlying APIs to also support the Zipkin provider.

In addition, it also exposes a new option to specify provider specific configuration such as TraceId128Bit and SharedSpanContext for Zipkin.

Which issue(s) this PR fixes:
Related to #1827

https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/trace/v3/zipkin.proto

@alexandermarston alexandermarston requested a review from a team as a code owner June 19, 2024 15:05
@alexandermarston alexandermarston force-pushed the telemetry-tracing-zipkin-api branch from 0c55a37 to 77f0415 Compare June 19, 2024 15:06
@zirain
Copy link
Member

zirain commented Jun 19, 2024

please revert changes under /internal

@alexandermarston
Copy link
Contributor Author

please revert changes under /internal

@zirain I have done so - shall I update the site docs? (site/content/en/latest/api/extension_types.md)


// ZipkinConfiguration defines optional configuration for the Zipkin tracing provider.
type ZipkinConfiguration struct {
// TraceId_128Bit determines whether a 128bit trace id will be used
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// TraceId_128Bit determines whether a 128bit trace id will be used
// TraceId128Bit determines whether a 128bit trace id will be used

@basvanbeek is it recommended to use 128bit by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Most libraries do 64bit as default allowing to be switched to 128 bit for those worried about trace collisions in very high request rate systems, or where retention is set to high.

Co-authored-by: zirain <[email protected]>
Signed-off-by: Alex Marston <[email protected]>
// share the same span context. Defaults to true.
// +kubebuilder:default=true
// +optional
SharedSpanContext bool `json:"sharedSpanContext,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

should we rename this to DisableSharedSpanContext and make the default value to false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seeing as SharedSpanContext defaults to true in the backend anyway, I think it makes sense to keep the naming of this field consistent.

Copy link
Member

Choose a reason for hiding this comment

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

An API should imporve the UX of most of the end users, envoy may use specific values due to backward compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@zirain
Copy link
Member

zirain commented Jun 19, 2024

please revert changes under /internal

@zirain I have done so - shall I update the site docs? (site/content/en/latest/api/extension_types.md)

run make -k gen-check will auto generated the docs.

Signed-off-by: Alex Marston <[email protected]>
Signed-off-by: Alex Marston <[email protected]>
Signed-off-by: Alex Marston <[email protected]>
Copy link

codecov bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.29%. Comparing base (9830c4d) to head (b906c34).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3630      +/-   ##
==========================================
- Coverage   68.29%   68.29%   -0.01%     
==========================================
  Files         170      170              
  Lines       20760    20760              
==========================================
- Hits        14179    14178       -1     
+ Misses       5563     5562       -1     
- Partials     1018     1020       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Alex Marston <[email protected]>
// CollectorHostname defines the hostname to use when sending spans
// to the Zipkin collector endpoint.
// +optional
CollectorHostname *string `json:"collectorHostname,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary for first iterate? There's a discussion about where's the right place for authoriy, here or under BackendRef

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not necessary but I lacked the context on the other discussion. Happy to pull this out and wait for the outcome of that discussion

Copy link
Member

Choose a reason for hiding this comment

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

The standard Zipkin ecosystem does nothing with this.

Signed-off-by: Alex Marston <[email protected]>
zirain
zirain previously approved these changes Jun 20, 2024
Copy link
Member

@zirain zirain left a comment

Choose a reason for hiding this comment

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

LGTM, @basvanbeek can you take a look?

Copy link
Member

@basvanbeek basvanbeek left a comment

Choose a reason for hiding this comment

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

LGTM

// when creating a new trace instance. If set to false, a 64bit trace
// id will be used.
// +optional
TraceID128Bit *bool `json:"traceId128Bit,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand this is creating a 1:1 mapping with envoy https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/trace/v3/zipkin.proto#extension-envoy-tracers-zipkin but this name is confusing
prefer if this was TraceIDSize/TraceIDLength *TraceIDType which could default to 64

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would EnableTraceID128Bit or Enable128BitTraceID be a better name?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah I'm a +1 for Enable128BitTraceID wdyt @envoyproxy/gateway-maintainers @basvanbeek

Copy link
Member

Choose a reason for hiding this comment

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

Enable128BitTraceID has my preference too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for input. Field name updated

Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM thanks !

@zirain
Copy link
Member

zirain commented Jun 24, 2024

/retest

@zirain zirain merged commit 51196b4 into envoyproxy:main Jun 24, 2024
26 checks passed
@alexandermarston alexandermarston deleted the telemetry-tracing-zipkin-api branch June 24, 2024 16:52
bjlhlin pushed a commit to bjlhlin/gateway that referenced this pull request Jun 25, 2024
* api: Adding Zipkin Tracing support

Signed-off-by: Alex Marston <[email protected]>

* rollback /internal changes

Signed-off-by: Alex Marston <[email protected]>

* nest zipkin configuration under TracingProvider struct

Signed-off-by: Alex Marston <[email protected]>

* rollback internal testdata changes

Signed-off-by: Alex Marston <[email protected]>

* rollback site changes

Signed-off-by: Alex Marston <[email protected]>

* Change ZipkinConfiguration to a pointer.

Co-authored-by: zirain <[email protected]>
Signed-off-by: Alex Marston <[email protected]>

* update deepcopy

Signed-off-by: Alex Marston <[email protected]>

* update description for TraceId128Bit field

Signed-off-by: Alex Marston <[email protected]>

* update site docs

Signed-off-by: Alex Marston <[email protected]>

* rename Zipkin config struct

Signed-off-by: Alex Marston <[email protected]>

* update api

Signed-off-by: Alex Marston <[email protected]>

* pointers for optional fields

Signed-off-by: Alex Marston <[email protected]>

* remove CollectorHostname

Signed-off-by: Alex Marston <[email protected]>

* TraceID128Bit -> Enable128BitTraceID

Signed-off-by: Alex Marston <[email protected]>

---------

Signed-off-by: Alex Marston <[email protected]>
Signed-off-by: Alex Marston <[email protected]>
Co-authored-by: zirain <[email protected]>
Signed-off-by: bjlhlin <[email protected]>
bjlhlin pushed a commit to bjlhlin/gateway that referenced this pull request Jun 26, 2024
* api: Adding Zipkin Tracing support

Signed-off-by: Alex Marston <[email protected]>

* rollback /internal changes

Signed-off-by: Alex Marston <[email protected]>

* nest zipkin configuration under TracingProvider struct

Signed-off-by: Alex Marston <[email protected]>

* rollback internal testdata changes

Signed-off-by: Alex Marston <[email protected]>

* rollback site changes

Signed-off-by: Alex Marston <[email protected]>

* Change ZipkinConfiguration to a pointer.

Co-authored-by: zirain <[email protected]>
Signed-off-by: Alex Marston <[email protected]>

* update deepcopy

Signed-off-by: Alex Marston <[email protected]>

* update description for TraceId128Bit field

Signed-off-by: Alex Marston <[email protected]>

* update site docs

Signed-off-by: Alex Marston <[email protected]>

* rename Zipkin config struct

Signed-off-by: Alex Marston <[email protected]>

* update api

Signed-off-by: Alex Marston <[email protected]>

* pointers for optional fields

Signed-off-by: Alex Marston <[email protected]>

* remove CollectorHostname

Signed-off-by: Alex Marston <[email protected]>

* TraceID128Bit -> Enable128BitTraceID

Signed-off-by: Alex Marston <[email protected]>

---------

Signed-off-by: Alex Marston <[email protected]>
Signed-off-by: Alex Marston <[email protected]>
Co-authored-by: zirain <[email protected]>
Signed-off-by: bjlhlin <[email protected]>
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.

4 participants