Skip to content

Conversation

@bboreham
Copy link

This PR takes the change in #487 from @lookfwd, rebases it against latest, and applies the suggested changes from @everett980.

Which problem is this PR solving?

  • There is a need to display additional information for each Span in a prominent position (next to operation name). For example, with the following config.json:
{
  "opLabelTag": "http.status_code"
}

we get:
8E0BC66E-B4F4-4598-A945-FDF80FE2052C

Short description of the changes

Adds a configuration option opLabelTag which, when set, shows the value of the specified opLabelTag Tag for a Span, if set, in parenthesis next to the operation name in the trace view.

I signed the extra commits as myself because I don't want to impersonate someone without permission, but the code is from @everett980. Some small changes were needed to let tests pass.

lookfwd and others added 6 commits February 22, 2021 18:12
`opLabel` is either false or a populated string.

Signed-off-by: Bryan Boreham <[email protected]>
Signed-off-by: Bryan Boreham <[email protected]>
Suggested by https://github.com/everett980:

By replacing `renderPattern` with a function that returns all parameter
values (or returns `false`) that function can be reused without creating
a partial `ProcessedLinkPattern` in `computeSingleTagPattern`.

Signed-off-by: Bryan Boreham <[email protected]>
Signed-off-by: Bryan Boreham <[email protected]>
Lint pointed this out

Signed-off-by: Bryan Boreham <[email protected]>
@codecov
Copy link

codecov bot commented Feb 23, 2021

Codecov Report

Merging #703 (f92906a) into master (6eac9c2) will increase coverage by 0.01%.
The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #703      +/-   ##
==========================================
+ Coverage   94.39%   94.40%   +0.01%     
==========================================
  Files         230      230              
  Lines        5959     5970      +11     
  Branches     1448     1454       +6     
==========================================
+ Hits         5625     5636      +11     
  Misses        300      300              
  Partials       34       34              
Impacted Files Coverage Δ
...ackages/jaeger-ui/src/constants/default-config.tsx 100.00% <ø> (ø)
packages/jaeger-ui/src/model/link-patterns.tsx 94.38% <91.66%> (+0.55%) ⬆️
...nents/TracePage/TraceTimelineViewer/SpanBarRow.tsx 75.00% <100.00%> (+2.58%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6eac9c2...e577666. Read the comment docs.

@yurishkuro
Copy link
Member

@th3M1ke would you be able to review this?

@th3M1ke
Copy link
Contributor

th3M1ke commented Feb 23, 2021

@yurishkuro sure! will review later today

onMissingFn?: (_: string) => void
) {
const parameterValues: Record<string, any> = {};
const allParameters = parameters.every(parameter => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we need allParameters?

onMissingFn?: (_: string) => void
) {
const parameterValues: Record<string, any> = {};
const allParameters = parameters.every(parameter => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const allParameters = parameters.every(parameter => {
parameters.forEach(parameter => {

To be able to render different paraments(from different scopes. HTTP calls statuses and Redis's driverID, for example)

Copy link
Author

Choose a reason for hiding this comment

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

This code is from @everett980 at https://github.com/jaegertracing/jaeger-ui/pull/487/files#r356227730.

What happens to return values if I make that change?
Are you proposing that the "all elements match otherwise nothing" behaviour be changed?
That was quite deliberate in the original PR; @lookfwd added a test for it

@jpkrohling
Copy link
Contributor

What's the state of this PR?

@bboreham
Copy link
Author

bboreham commented Jul 7, 2021

I was awaiting further comment.
I asked a couple of questions for clarification at #703 (comment)

@jpkrohling
Copy link
Contributor

@rubenvp8510 could you please review this one?

@drewcorlin1
Copy link
Contributor

This is quite an old what, any chance of this getting revived? I'd be happy to help out

@bboreham
Copy link
Author

It's unlikely that I would be able to put a lot of time into it, but I was only tidying up other people's work; very happy if you want to pick it up.

@github-actions
Copy link

github-actions bot commented Sep 1, 2025

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. You may re-open it if you need more time.

@github-actions github-actions bot added the stale label Sep 1, 2025
const viewBounds = getViewedBounds(span.startTime, span.startTime + span.duration);
const viewStart = viewBounds.start;
const viewEnd = viewBounds.end;
const opLabelPattern = getConfigValue('opLabel');
Copy link
Contributor

Choose a reason for hiding this comment

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

There appears to be a configuration key mismatch that will prevent this feature from working correctly. The PR description and tests reference opLabelTag as the configuration key, but the implementation is using getConfigValue('opLabel') and the default config defines opLabel: null.

To ensure the feature works as intended, please change:

const opLabelPattern = getConfigValue('opLabel');

to:

const opLabelPattern = getConfigValue('opLabelTag');

Additionally, the default config should be updated to match this naming convention for consistency.

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

);
}

export function computeSingleTagPattern(pattern: String, span: Span) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The type annotation for pattern should be string (primitive) rather than String (object wrapper). This mismatch could cause runtime type errors since the function receives string primitives but expects String objects. Changing String to string will ensure proper TypeScript typing.

Suggested change
export function computeSingleTagPattern(pattern: String, span: Span) {
export function computeSingleTagPattern(pattern: string, span: Span) {

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

expect(wrapper.find('.endpoint-name').text()).toBe(props.rpc.operationName);
});

it('has expected lebel when no rpc', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a small typo in the test description: lebel should be label. While this is just a test description, typos in test names can make it harder to understand test coverage when reviewing or debugging tests.

Suggested change
it('has expected lebel when no rpc', () => {
it('has expected label when no rpc', () => {

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@github-actions github-actions bot removed the stale label Sep 8, 2025
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. You may re-open it if you need more time.

@github-actions github-actions bot added the stale label Nov 10, 2025
@github-actions
Copy link

This pull request has been automatically closed due to inactivity. You may re-open it if you need more time. We really appreciate your contribution and we are sorry that this has not been completed.

@github-actions github-actions bot closed this Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants