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

[Bug]: The results filtered through the tag in the findtrace page did not match expectations #5290

Closed
JaredTan95 opened this issue Mar 22, 2024 · 12 comments · Fixed by jaegertracing/jaeger-ui#2354
Labels

Comments

@JaredTan95
Copy link
Contributor

What happened?

No data is found when filtering traces through the following tag:

http.url=http://sss.xxx.com/v1/user/spaces/1310e65f-16c6-4502-a9ef-15e0ff38e8b2/zone_roles?service_name=ss.sss.xxx.com,

Is it because the value contains the special symbol = at the end? Because passing the following query is normal:

http.url=http://sss.xxx.com/v2/healthchaeck

Steps to reproduce

Filter traces data through the following tags:

http.url=http://sss.xxx.com/v1/user/spaces/1310e65f-16c6-4502-a9ef-15e0ff38e8b2/zone_roles?service_name=ss.sss.xxx.com,

Expected behavior

Filter out the data correctly

Relevant log output

No response

Screenshot

image image

Additional context

No response

Jaeger backend version

1.49.0

SDK

No response

Pipeline

No response

Stogage backend

No response

Operating system

No response

Deployment model

No response

Deployment configs

No response

@JaredTan95 JaredTan95 added the bug label Mar 22, 2024
@yurishkuro
Copy link
Member

did you try the advice in the tooltip?

image

(the tooltip has a typo, I put a fix jaegertracing/jaeger-ui#2224)

@JaredTan95
Copy link
Contributor Author

Thank you for your reply.
I used ' to wrap = like '=' for query according to what you said. Unfortunately, still failed to filter out the data:

http.url=http://sss.xxx.com/v1/user/spaces/1310e65f-16c6-4502-a9ef-15e0ff38e8b2/zone_roles?service_name'='ss.sss.xxx.com

@jkowall
Copy link
Contributor

jkowall commented Jun 8, 2024

@JaredTan95 What is the backend you are using?

@JaredTan95
Copy link
Contributor Author

JaredTan95 commented Jun 9, 2024

@JaredTan95 What is the backend you are using?

  • jaeger 1.49.0
  • jaeger ui 1.33.0
image

@yurishkuro
Copy link
Member

quotes around the value: http.url="http://sss.xxx.com/v1/user/spaces/1310e65f-16c6-4502-a9ef-15e0ff38e8b2/zone_roles?service_name=ss.sss.xxx.com"

@JaredTan95
Copy link
Contributor Author

quotes around the value: http.url="http://sss.xxx.com/v1/user/spaces/1310e65f-16c6-4502-a9ef-15e0ff38e8b2/zone_roles?service_name=ss.sss.xxx.com"

Thank you for your reply, but according to your reply, it is still not effective

@yurishkuro
Copy link
Member

Works for me in the HotROD demo (with memstore)

image

@my-git9
Copy link
Contributor

my-git9 commented Jun 21, 2024

There is also a problem in my environment:

image image image

The version information is:

image

@yurishkuro
Copy link
Member

Which storage backend?

@scx1st
Copy link

scx1st commented Jun 22, 2024

Which storage backend?

ES

@yurishkuro
Copy link
Member

I figured it out. The ES tag queries are considered regex queries. So it's not the = sign that trips the search, it's the ?.

Here is example where the search fails:
image

And here's example where it succeeds, after adding an escape character \\ in front of ?

image

This is actually documented in the help popup:

image

yurishkuro added a commit that referenced this issue Jun 23, 2024
## Which problem is this PR solving?
- Part of #5290
- It's difficult to troubleshoot ES queries because logs are always
written in JSON format, so the ES req/resp JSON is being escaped.

## Description of the changes
- Add `--log-encoding` option to allow changing logs to plain text
(console).
- Fix logger initialization for ES to reuse the existing logger instead
of creating a new one (new one was switching back to JSON)

## How was this change tested?
```
$ SPAN_STORAGE_TYPE=elasticsearch go run -tags=ui ./cmd/all-in-one --es.log-level=debug --log-encoding=console
```
A query is logged like this:
```
2024-06-22T22:56:34.272-0400	info	elastic@v6.2.37+incompatible/client.go:835	GET /_msearch?rest_total_hits_as_int=true HTTP/1.1
Host: 127.0.0.1:9200
User-Agent: elastic/6.2.37 (darwin-arm64)
Content-Length: 310
Accept: application/json
Content-Type: application/json
Accept-Encoding: gzip

{"ignore_unavailable":true,"indices":["jaeger-span-2024-06-23","jaeger-span-2024-06-22","jaeger-span-2024-06-21","jaeger-span-2024-06-20"]}
{"query":{"bool":{"must":{"term":{"traceID":"1a2cee16e928c8a2f00d9ae784d8cccc"}}}},"search_after":[1718848594271777],"size":10000,"sort":[{"startTime":{"order":"asc"}}]}
```


## Checklist
- [ ] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [ ] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [ ] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Yuri Shkuro <github@ysh.us>
yurishkuro added a commit to jaegertracing/jaeger-ui that referenced this issue Jun 23, 2024
## Which problem is this PR solving?
- Resolves jaegertracing/jaeger#5290

## Description of the changes
- Add example of escaping reserved characters

## How was this change tested?
<img width="1000" alt="image"
src="https://github.com/jaegertracing/jaeger-ui/assets/3523016/16424fc8-9fab-4735-88bc-116448f5dcb0">

Signed-off-by: Yuri Shkuro <github@ysh.us>
@JaredTan95
Copy link
Contributor Author

Thanks a lot, It works~

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 a pull request may close this issue.

5 participants