Skip to content

Add Labels from a path as oc-collector attributes#463

Merged
olix0r merged 15 commits intolinkerd:masterfrom
Pothulapati:trace-names
Apr 13, 2020
Merged

Add Labels from a path as oc-collector attributes#463
olix0r merged 15 commits intolinkerd:masterfrom
Pothulapati:trace-names

Conversation

@Pothulapati
Copy link
Contributor

Fixes linkerd/linkerd2#4008

This PR makes the proxy read file present at /var/run/linkerd/podinfo/labels and convert it into a HashMap and use those labels as attributes for spans/traces.

linkerd/linkerd2#4199 updates the control-plane helm charts to mount pod labels as file to the proxy coontainer using downwardAPI

With these changes, Traces would have pod labels as attributes, Allowing us to directly link jager dashboard links from the Linkerd dashboard (like we do with Grafana), part of linkerd/linkerd2#4177 . This was not possible previously because we didn't have a way to know the distinguish traces based on workloadKind and workloadName

Screenshot_2020-03-25 Jaeger UI
image

P.S: This is my first take in Rust and the proxy, Sorry if there are any mistakes :)
Signed-off-by: Tarun Pothulapati [email protected]

@Pothulapati Pothulapati changed the title Read labels from the path and add them to the oc-collector attributes Add Labels from a path as oc-collector attributes Mar 25, 2020
Signed-off-by: Tarun Pothulapati <[email protected]>
Copy link
Contributor

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

I had a few minor nits & suggestions. In general, I agree with Oliver's comments on the label parsing code.

Also, unit tests for convert fn

Signed-off-by: Tarun Pothulapati <[email protected]>
Signed-off-by: Tarun Pothulapati <[email protected]>
Signed-off-by: Tarun Pothulapati <[email protected]>
Signed-off-by: Tarun Pothulapati <[email protected]>
@Pothulapati
Copy link
Contributor Author

@hawkw @olix0r K8s has gurantees on what kinds of keys and values it allows as labels. It allows the value to be empty in which case, the pair is written to the file as new="", which we succesfully consider. and we do the same even when key is empty (though k8s dosen't allow them)

One concern I have is for future cases (i.e mesh expansion, etc), For Labels without value, Users have to add =, as we ignore labels without = even though value is empty, Should we allow that?

@olix0r
Copy link
Member

olix0r commented Mar 26, 2020

@Pothulapati

For Labels without value, Users have to add =, as we ignore labels without = even though value is empty, Should we allow that?

Can you elaborate on this? Can you give an example of how a user would interact with this? I would imagine that users never have to interact with any of this stuff outside of the normal k8s tooling?

@Pothulapati
Copy link
Contributor Author

@olix0r Yep, no direct interaction as you mentioned but my concern was for future cases outside k8s (mesh expansion? ), where users would have to add the labels manually into a file, and even for labels without values, = has to be added.

@olix0r
Copy link
Member

olix0r commented Mar 26, 2020

where users would have to add the labels manually into a file

I don't think we'd ever do this, fwiw.

@Pothulapati
Copy link
Contributor Author

Updated the proxy code to also include namespace label. Especially useful for jaeger integration into the Linkerd dashboard.
Screenshot_2020-04-06 Jaeger UI(1)
Screenshot_2020-04-06 Jaeger UI

Copy link
Member

@olix0r olix0r left a comment

Choose a reason for hiding this comment

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

In order to merge this, we at least need to back out the current approach to namespaces. If namespaces are required, we need to figure out an alternate approach.

Copy link
Contributor

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

In general, I agree with @olix0r's review. I also left some notes on idiomatic Rust that I hope you find helpful.

Signed-off-by: Tarun Pothulapati <[email protected]>
Copy link
Member

@olix0r olix0r left a comment

Choose a reason for hiding this comment

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

Thanks, @Pothulapati !

@olix0r olix0r merged commit 270d343 into linkerd:master Apr 13, 2020
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Apr 15, 2020
This release includes a new protocol detection timeout, which prevents
clients from consuming resources indefinitely when they do not send any
data.

Additionally: the proxy's admin endpoint now supports a `/live` endpoint
for liveness checks, and a feature has been added to enrich tracing
metadata from a file of label/values.

---

* Add Labels from a path as oc-collector attributes (linkerd/linkerd2-proxy#463)
* Add liveness endpoint to admin server (linkerd/linkerd2-proxy#470)
* docker: Use buildkit for caching (linkerd/linkerd2-proxy#472)
* Makefile: Use STRIP variable with strip as default (linkerd/linkerd2-proxy#475)
* Add checksec to the release process (linkerd/linkerd2-proxy#476)
* Time out protocol detect futures (linkerd/linkerd2-proxy#464)
* Ensure that checksec is executable (linkerd/linkerd2-proxy#477)
* Fix the checksec URL (linkerd/linkerd2-proxy#478)
* Undo hardcoded release version (linkerd/linkerd2-proxy#479)
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Apr 16, 2020
This release includes a new protocol detection timeout, which prevents
clients from consuming resources indefinitely when they do not send any
data.

Additionally: the proxy's admin endpoint now supports a `/live` endpoint
for liveness checks, and a feature has been added to enrich tracing
metadata from a file of label/values.

---

* Add Labels from a path as oc-collector attributes (linkerd/linkerd2-proxy#463)
* Add liveness endpoint to admin server (linkerd/linkerd2-proxy#470)
* docker: Use buildkit for caching (linkerd/linkerd2-proxy#472)
* Makefile: Use STRIP variable with strip as default (linkerd/linkerd2-proxy#475)
* Add checksec to the release process (linkerd/linkerd2-proxy#476)
* Time out protocol detect futures (linkerd/linkerd2-proxy#464)
* Ensure that checksec is executable (linkerd/linkerd2-proxy#477)
* Fix the checksec URL (linkerd/linkerd2-proxy#478)
* Undo hardcoded release version (linkerd/linkerd2-proxy#479)
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.

Owner Metadata for Spans.

3 participants