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

Information about the import "JSON File" feature #381

Closed
abravalheri opened this issue May 20, 2019 · 6 comments
Closed

Information about the import "JSON File" feature #381

abravalheri opened this issue May 20, 2019 · 6 comments

Comments

@abravalheri
Copy link

Thank you very much guys for the wonderful software and opensource community, and specially by providing the very useful feature of loading a JSON file into the UI (PR #327).

Unfortunately, I run into some problems while trying to use this feature... Would you mind to help me to identify if I am doing something wrong?

My use case is that I would like to use Jaeger UI to analyse a system which data is being provided by external partners (so I don't have access to their infrastructure to run Jaeger directly in a real time manner).

Before asking them to provide the exported JSON files, I tried to run an experiment just to get used to this feature and see how it works.

I started by running the all-in-one container for version 1.12 (using the exact command as indicated in the Getting Started), accessing the web UI in the 16686 port, and uploading the fixture file that I found in the main repository. Unfortunately, the UI got stuck displaying a endless loading animation, and I've got the following error in the javascript console:

TypeError: A.payload.data is undefined [Learn More]     trace.js:134:8

I have also tried to run it with other fixtures (from this folder) and I got the same error. As a final test, I have tried to run the all-in-one container again, but using version 1.11. For v1.11, the UI got stuck with the endless loading animation, however no error was displayed in the JS console. Looking in the Network tab in the developer's console, no XHR seems to be performed when uploading the JSON file. (Tests were executed in both Chrome 74 and Firefox 66)

Am I doing something wrong? Maybe I am not supposed to use those fixtures to test this import feature (in that case, do you have any fixture that I could try?)... Would you have any advise on how to get started with this feature properly?

Thanks again for the wonderful software and all the features.

Kind regards

Requirement - what kind of business use case are you trying to solve?

  • Use Jaeger UI to analyse past data provided by 3rd parties.

Problem - what in Jaeger blocks you from solving the requirement?

  • Jaeger UI get stuck in an endless "loading" animation when a JSON file is loaded (the fixture file in the main repository is being used).
@rubenvp8510
Copy link
Collaborator

I think the format of the fixture is not the expected format for the UI, the UI expect an array of traces wrapped into TraceData object which is in this form:


{
  data: [
       { ...traceObject1 }
       {... traceObject2 }
   ]
}

Also there is an issue with null references and null tags fields, I'm not sure if null value is a valid value for those, I sent a PR: #382

@rubenvp8510
Copy link
Collaborator

This is an example:

{
	"data": [{
		"traceID": "665b3cc06e48f122",
		"spans": [{
				"traceID": "665b3cc06e48f122",
				"spanID": "616bc4df9f135fcd",
				"flags": 1,
				"operationName": "HTTP GET: /customer",
				"references": [{
					"refType": "CHILD_OF",
					"traceID": "665b3cc06e48f122",
					"spanID": "665b3cc06e48f122"
				}],
				"startTime": 1555385360015391,
				"duration": 179848,
				"tags": [],
				"logs": [],
				"processID": "p2"
			},
			{
				"traceID": "665b3cc06e48f122",
				"spanID": "665b3cc06e48f122",
				"flags": 1,
				"operationName": "HTTP GET /dispatch",
				"references": [],
				"startTime": 1555385360015391,
				"duration": 279850,
				"tags": [{
						"key": "sampler.type",
						"type": "string",
						"value": "const"
					},
					{
						"key": "sampler.param",
						"type": "bool",
						"value": true
					},
					{
						"key": "span.kind",
						"type": "string",
						"value": "server"
					},
					{
						"key": "http.method",
						"type": "string",
						"value": "GET"
					},
					{
						"key": "http.url",
						"type": "string",
						"value": "/dispatch?customer=123"
					},
					{
						"key": "component",
						"type": "string",
						"value": "net/http"
					},
					{
						"key": "http.status_code",
						"type": "int64",
						"value": 200
					}
				],
				"logs": [{
						"timestamp": 1555372921477590,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "HTTP request received"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							},
							{
								"key": "method",
								"type": "string",
								"value": "GET"
							},
							{
								"key": "url",
								"type": "string",
								"value": "/dispatch?customer=123"
							}
						]
					},
					{
						"timestamp": 1555372921477628,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Getting customer"
							},
							{
								"key": "customer_id",
								"type": "string",
								"value": "123"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							}
						]
					},
					{
						"timestamp": 1555372921826687,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Found customer"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							}
						]
					},
					{
						"timestamp": 1555372921826818,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "baggage"
							},
							{
								"key": "key",
								"type": "string",
								"value": "customer"
							},
							{
								"key": "value",
								"type": "string",
								"value": "Rachel's Floral Designs"
							}
						]
					},
					{
						"timestamp": 1555372921826826,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Finding nearest drivers"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							},
							{
								"key": "location",
								"type": "string",
								"value": "115,277"
							}
						]
					},
					{
						"timestamp": 1555372922042864,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Found drivers"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							}
						]
					},
					{
						"timestamp": 1555372922043042,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Finding route"
							},
							{
								"key": "dropoff",
								"type": "string",
								"value": "115,277"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							},
							{
								"key": "pickup",
								"type": "string",
								"value": "193,463"
							}
						]
					},
					{
						"timestamp": 1555372922043065,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Finding route"
							},
							{
								"key": "dropoff",
								"type": "string",
								"value": "115,277"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							},
							{
								"key": "pickup",
								"type": "string",
								"value": "41,921"
							}
						]
					},
					{
						"timestamp": 1555372922043088,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Finding route"
							},
							{
								"key": "dropoff",
								"type": "string",
								"value": "115,277"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							},
							{
								"key": "pickup",
								"type": "string",
								"value": "424,920"
							}
						]
					},
					{
						"timestamp": 1555372922095106,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Finding route"
							},
							{
								"key": "dropoff",
								"type": "string",
								"value": "115,277"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							},
							{
								"key": "pickup",
								"type": "string",
								"value": "428,634"
							}
						]
					},
					{
						"timestamp": 1555372922095484,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Finding route"
							},
							{
								"key": "dropoff",
								"type": "string",
								"value": "115,277"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							},
							{
								"key": "pickup",
								"type": "string",
								"value": "474,159"
							}
						]
					},
					{
						"timestamp": 1555372922100523,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Finding route"
							},
							{
								"key": "dropoff",
								"type": "string",
								"value": "115,277"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							},
							{
								"key": "pickup",
								"type": "string",
								"value": "349,919"
							}
						]
					},
					{
						"timestamp": 1555372922120556,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Finding route"
							},
							{
								"key": "dropoff",
								"type": "string",
								"value": "115,277"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							},
							{
								"key": "pickup",
								"type": "string",
								"value": "418,360"
							}
						]
					},
					{
						"timestamp": 1555372922142665,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Finding route"
							},
							{
								"key": "dropoff",
								"type": "string",
								"value": "115,277"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							},
							{
								"key": "pickup",
								"type": "string",
								"value": "126,773"
							}
						]
					},
					{
						"timestamp": 1555372922162291,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Finding route"
							},
							{
								"key": "dropoff",
								"type": "string",
								"value": "115,277"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							},
							{
								"key": "pickup",
								"type": "string",
								"value": "208,292"
							}
						]
					},
					{
						"timestamp": 1555372922183561,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Finding route"
							},
							{
								"key": "dropoff",
								"type": "string",
								"value": "115,277"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							},
							{
								"key": "pickup",
								"type": "string",
								"value": "386,239"
							}
						]
					},
					{
						"timestamp": 1555372922251251,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Found routes"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							}
						]
					},
					{
						"timestamp": 1555372922251325,
						"fields": [{
								"key": "event",
								"type": "string",
								"value": "Dispatch successful"
							},
							{
								"key": "driver",
								"type": "string",
								"value": "T757304C"
							},
							{
								"key": "eta",
								"type": "string",
								"value": "2m0s"
							},
							{
								"key": "level",
								"type": "string",
								"value": "info"
							}
						]
					}
				],
				"processID": "p4",
				"warnings": null
			}
		],
		"processes": {
			"p4": {
				"serviceName": "frontend",
				"tags": [{
						"key": "client-uuid",
						"type": "string",
						"value": "3a9fd4913b360df4"
					},
					{
						"key": "hostname",
						"type": "string",
						"value": "localhost.localdomain"
					},
					{
						"key": "ip",
						"type": "string",
						"value": "192.168.1.102"
					},
					{
						"key": "jaeger.version",
						"type": "string",
						"value": "Go-2.15.1dev"
					}
				]
			},
			"p2": {
				"serviceName": "frontend",
				"tags": [{
					"key": "client-uuid",
					"type": "string",
					"value": "3a9fd4913b360df4"
				}, {
					"key": "hostname",
					"type": "string",
					"value": "localhost.localdomain"
				}, {
					"key": "ip",
					"type": "string",
					"value": "192.168.1.102"
				}, {
					"key": "jaeger.version",
					"type": "string",
					"value": "Go-2.15.1dev"
				}]
			}
		}
	}]
}

@abravalheri
Copy link
Author

Thank you very much @rubenvp8510, it helped a lot!

Using your example, I managed to successfully use the feature in v1.11 to import the JSON!
(Still getting an error in v1.12 - should I leave this issue open until v1.12 works correctly?)

@rubenvp8510
Copy link
Collaborator

Thank you very much @rubenvp8510, it helped a lot!

Using your example, I managed to successfully use the feature in v1.11 to import the JSON!
(Still getting an error in v1.12 - should I leave this issue open until v1.12 works correctly?)

@abravalheri Yes, we can leave this open.

Not sure if is the issue you are seeing but I found a bug when in order to load a JSON file you need to click on search button first, (it does not matter if the result is empty or whatever) and then you can load the JSON. I sent a PR #383 for that.

Is the same issue you are facing?

Thanks.

@jkowall jkowall closed this as completed Oct 15, 2021
@yaojingguo
Copy link

https://github.com/jaegertracing/jaeger/blob/96026e68a9111accdb7b20e5307507e642ce9549/model/json/fixture.json is fixture.json at the master branch. It can't be imported with JSON file.

截屏2022-02-09 下午2 39 56

But the JSON file given in #381 (comment) works.

Should fixture.json be updated?

@yurishkuro
Copy link
Member

But the JSON file given in #381 (comment) works.
Should fixture.json be updated?

These files serve different purposes and are different format. If you wrap the fixture JSON in the data element as the actual one, you may be able to import it. But you may still run into other issues since fixtures are not meant for that, they are testing specific things with mock data. For instance, UI might now like timestamp=5000.

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

No branches or pull requests

5 participants