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

feat: Add baggageItemToTag filter #1160

Merged
merged 2 commits into from
Aug 26, 2019
Merged

feat: Add baggageItemToTag filter #1160

merged 2 commits into from
Aug 26, 2019

Conversation

addityasingh
Copy link
Contributor

@addityasingh addityasingh commented Aug 26, 2019

Add baggageItemToTag filter

This filter adds an opentracing tag for a given baggage item in the trace.

Syntax:

baggageItemToTag("<baggage_item_name>", "<tag_name>")

Example: If a trace consists of baggage item named foo with a value bar. Adding below filter will add a tag named baz with value bar

baggageItemToTag("foo", "baz")

Signed-off-by: Aditya Pratap Singh <[email protected]>
@szuecs
Copy link
Member

szuecs commented Aug 26, 2019

@addityasingh thanks for the PR, can you please also add something in the documentation?
docs/reference/filters.md would need an update

@aryszka
Copy link
Contributor

aryszka commented Aug 26, 2019

👍

1 similar comment
@szuecs
Copy link
Member

szuecs commented Aug 26, 2019

👍

@szuecs szuecs merged commit 2d7d9c5 into zalando:master Aug 26, 2019
@addityasingh addityasingh deleted the as-baggage-to-tag branch August 26, 2019 14:25
@@ -1528,3 +1528,17 @@ directory, but it won't walk subtrees. For the example case, there
have to be filenames `write-token` and `read-token` within the
specified credential paths `/tmp/secrets/`, resulting in
`/tmp/secrets/write-token` and `/tmp/secrets/read-token`.

## baggageItemToTag
Copy link
Member

Choose a reason for hiding this comment

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

Is baggage a general term used in OpenTracing? Just looking at the filter name baggageItemToTag I had no idea it had anything to do with OpenTracing but maybe it's just a convention that I'm not familiar with?

It's documented so I can learn that it's an OpenTracing thing but ideally filter names should be somewhat descriptive on their own.

Copy link
Member

@szuecs szuecs Aug 28, 2019

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Baggage is indeed a term used in opentracing to represent information valid throughout the process boundaries, unlike Span or Logs https://opentracing.io/docs/overview/tags-logs-baggage/

@aryszka
Copy link
Contributor

aryszka commented Aug 28, 2019

thx @mikkeloscar . I think I get your concern. From Skipper's perspective it may not be necessary clear, what kind of 'baggage' this suppose to be. My suggestion now is to rename it to: tracingBaggageToSpan. Wdyt?

@szuecs
Copy link
Member

szuecs commented Aug 28, 2019

@aryzska that is even more weird to me.
We copy from span.BagageItem to span.Tag.
Do I miss something?

@addityasingh
Copy link
Contributor Author

IMO the name is self explanatory if we consider that BaggageItem and Tags are part of the core components of opentracing(https://opentracing.io/docs/overview/tags-logs-baggage/)

@szuecs
Copy link
Member

szuecs commented Aug 29, 2019

I agree, but maybe we should link in our docs to the opentracing docs

@lmineiro
Copy link
Contributor

I'm late to this party. For consistency, it probably would've been better to prefix with tracing just like the filter tracingSpanName

@mikkeloscar
Copy link
Member

Thanks I understand now that there were some meaningful reason behind the name in the context of open tracing, however I would still argue that we should avoid using such names in a "global" namespace of filter names. It's not unlikely that other parts of the system could have similar terminology internally as OpenTracing. I agree with @lmineiro that having it prefixed with tracing would make sense, similar to how the oauth filters also have the oauth prefix :)

@aryszka
Copy link
Contributor

aryszka commented Aug 29, 2019

prefixing was my intention, too, while keeping it short. Maybe a good name would be: tracingBaggageToTag (@szuecs you're right, tag is better than span)

@addityasingh
Copy link
Contributor Author

Cool. I will update the name and create a PR later today with tracingBaggageToTag

@addityasingh
Copy link
Contributor Author

@mikkeloscar This PR(#1168) addresses the renaming

AlexanderYastrebov added a commit that referenced this pull request Sep 24, 2024
Implementation allows single argument variant which
is used in the wild so document it.

Follow up on #1160 and #1168

Signed-off-by: Alexander Yastrebov <[email protected]>
AlexanderYastrebov added a commit that referenced this pull request Sep 24, 2024
Implementation allows single argument variant which
is used in the wild so document it.

Follow up on #1160 and #1168

Signed-off-by: Alexander Yastrebov <[email protected]>
AlexanderYastrebov added a commit that referenced this pull request Sep 24, 2024
Implementation allows single argument variant which
is used in the wild so document it.

Follow up on #1160 and #1168

Signed-off-by: Alexander Yastrebov <[email protected]>
Pushpalanka pushed a commit that referenced this pull request Oct 11, 2024
Implementation allows single argument variant which
is used in the wild so document it.

Follow up on #1160 and #1168

Signed-off-by: Alexander Yastrebov <[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.

5 participants