question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tracking Issue for Attributes being Experimental.

See original GitHub issue

In #1700 it was decided that Attributes is still experimental. This issue is acts the the reference from the source code.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:24 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
ejona86commented, Dec 1, 2017

API review:

  • Key.of(debugString) is actually a bit weird; we were originally doing Key.of(name) which isn’t as weird. Across all similar key types (Context, Attributes, and this one), we want to swap to the form Key.create(debugString) and Key.createWithDefault(debugString, T default). So that would mean adding create here and deprecating of().
  • Consider removing keys(); need to investigate what it is being used for. We’re fine with it, but it is a bit weird; we’re not sure what it’s useful for. We are okay with keys() here because Attributes was intended to be an immutable (and type-safe) map and is only really passed between the producer and consumer. Unlike Context and CallOptions, there doesn’t seem much point to visibility-restricting certain keys (so you can’t access the value if you can’t get at the instance), which is the main thing having keys() would defeat. But because each key is semantically quite distinct, it is hard to determine what someone is using it for.
  • Replace static newBuilder(Attributes) with non-static toBuilder(). Deprecate (and later remove) newBuilder(Attributes)

With those tweaks, looks good to stabilize.

0reactions
ejona86commented, Jun 2, 2022

If this was done on purpose then I suppose that there should be another way to get attribute by name.

The thing is that attribute keys don’t have a name. The string passed is a debug string. We could maybe add some more language to Attributes.Key to at least mention “uses reference equality” like we do for CallOptions.Key or fuller text like we have in Context.Key (although that full text requires keys() to be removed).

Attributes is generic and used in multiple different circumstances. The ones listed in Grpc may not be exhaustive. A specific transport can have its own, for example. But it does seem we could add a breadcrumb in the {Client,Server}Call.getAttributes() javadoc to point to Grpc as the source of some of the common attributes. We should change the debug string to also be the API name for the key; if you saw the debug string as io.grpc.Grpc.TRANSPORT_ATTR_REMOTE_ADDR then the way to use it becomes obvious.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using eye tracking to account for attribute non-attendance in ...
Abstract: This study uses eye-tracking measures to account for attribute non-attendance (ANA) in choice experiments. Using the case of sustainability labelling ...
Read more >
Using eye tracking to account for attribute non-attendance in ...
This study uses eye-tracking measures to account for attribute non-attendance (ANA) in choice experiments. Using the case of sustainability labelling on coffee, ...
Read more >
Attribute Non-Attendance as an Information Processing ...
Discrete choice experiments (CE) are now a common tool for measuring economic preferences and values for both market and non-market goods in transportation...
Read more >
Learning Attribute-Specific Representations for Visual Tracking
After being trained on the VOT datasets, the pro- ... we show that tracking challenges (also known as attributes) ... Experiments show that....
Read more >
Equalizing bias in eliciting attribute weights in multiattribute ...
5 EXPERIMENTAL STUDIES. 5.1 Decision problem scenario. This study uses a public transportation mode selection problem, the main aim being to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found