-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
TraceID : Fetching TraceID #6797
Conversation
Hello @yeya24 Please Review |
// Access the response headers | ||
const traceIdHeader = resp.headers.get('X-Thanos-Trace-Id'); | ||
// Set the traceId state | ||
this.setState({ traceId: traceIdHeader }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just join these two lines together into one (https://github.com/thanos-io/thanos/blob/main/docs/contributing/coding-style-guide.md#avoid-defining-variables-used-only-once) and remove the comments since it is obvious what is happening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Vanshikav123 This is still not addressed.
if (event.target.checked && this.state.traceId) { | ||
this.setState({ hoverMessage: `TraceID: ${this.state.traceId}` }); | ||
} else if (event.target.checked) { | ||
this.setState({ hoverMessage: 'TraceID is not available. Enable it in your options.' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this show up if the option is checked but a query hasn't been executed yet? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will look into it more deeply 👍
Thank you for the reviews i think i should remove the condition checking the force tracing condition and instead check whether the query is executed or not . |
Please Review |
@@ -116,6 +119,9 @@ class Panel extends Component<PanelProps & PathPrefixProps, PanelState> { | |||
exprInputValue: props.options.expr, | |||
explainOutput: null, | |||
analysis: null, | |||
traceId: null, // Initialize traceId to null. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is self explanatory. We can remove the comment
@@ -58,6 +58,9 @@ interface PanelState { | |||
exprInputValue: string; | |||
analysis: QueryTree | null; | |||
explainOutput: ExplainTree | null; | |||
traceId: string | null; //Include traceId in the state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is self explanatory. We can remove the comment
It is probably also required for you to run |
@Vanshikav123 Can you please regenerate the bindata file? |
Done |
CI failed. Probably you need to generate bindata again. |
I am trying to test this feature but I didn't get how to use it. @Vanshikav123 Can you please update the pr description and mention how the UX works? Where will the traceID be displayed? |
Actually i will not be able to provide you with the screenshot because my UI is not responding but i will surely provide you with more information about the PR. |
I everytime run |
Thank you ! @yeya24 for this suggestion , I think this will look good and more informative , I will implement this soon |
Is this ready for another round of review? |
Sorry for the delay , I will push my changes ASAP and will inform you |
c808877
to
e7aecb4
Compare
Hello @yeya24 I would like to close this branch and will open a new PR soon because the implementation is different from what i did earlier. |
Changes
Made changes by adding the TraceID in panel state and fetched the header made a Hover feature for tracing the TraceID
#6774