Skip to content

api: Adding Zipkin Tracing support#3630

Merged
zirain merged 16 commits intoenvoyproxy:mainfrom
alexandermarston:telemetry-tracing-zipkin-api
Jun 24, 2024
Merged

api: Adding Zipkin Tracing support#3630
zirain merged 16 commits intoenvoyproxy:mainfrom
alexandermarston:telemetry-tracing-zipkin-api

Conversation

@alexandermarston
Copy link
Copy Markdown
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
Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>
@alexandermarston alexandermarston force-pushed the telemetry-tracing-zipkin-api branch from 0c55a37 to 77f0415 Compare June 19, 2024 15:06
@zirain
Copy link
Copy Markdown
Member

zirain commented Jun 19, 2024

please revert changes under /internal

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>
Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>
Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>
Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>
@alexandermarston
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
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 <zirain2009@gmail.com>
Signed-off-by: Alex Marston <alexander.marston@gmail.com>
// share the same span context. Defaults to true.
// +kubebuilder:default=true
// +optional
SharedSpanContext bool `json:"sharedSpanContext,omitempty"`
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 <alexander.marston@imaginecurve.com>
Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>
Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>
Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>
@codecov
Copy link
Copy Markdown

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.

alexandermarston and others added 2 commits June 20, 2024 08:02
Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>
Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>
// CollectorHostname defines the hostname to use when sending spans
// to the Zipkin collector endpoint.
// +optional
CollectorHostname *string `json:"collectorHostname,omitempty"`
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 <alexander.marston@imaginecurve.com>
zirain
zirain previously approved these changes Jun 20, 2024
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>
Copy link
Copy Markdown
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
Copy Markdown
Member

zirain commented Jun 24, 2024

/retest

@zirain zirain merged commit 51196b4 into envoyproxy:main Jun 24, 2024
@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 26, 2024
* api: Adding Zipkin Tracing support

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>

* rollback /internal changes

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>

* nest zipkin configuration under TracingProvider struct

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>

* rollback internal testdata changes

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>

* rollback site changes

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>

* Change ZipkinConfiguration to a pointer.

Co-authored-by: zirain <zirain2009@gmail.com>
Signed-off-by: Alex Marston <alexander.marston@gmail.com>

* update deepcopy

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>

* update description for TraceId128Bit field

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>

* update site docs

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>

* rename Zipkin config struct

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>

* update api

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>

* pointers for optional fields

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>

* remove CollectorHostname

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>

* TraceID128Bit -> Enable128BitTraceID

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>

---------

Signed-off-by: Alex Marston <alexander.marston@imaginecurve.com>
Signed-off-by: Alex Marston <alexander.marston@gmail.com>
Co-authored-by: zirain <zirain2009@gmail.com>
Signed-off-by: bjlhlin <lihonglin1@jd.com>
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