-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Ability to upload OTLP data into UI #4949
Comments
OTLP upload is not supported in the UI, but it's a nice feature which isn't too hard to implement. The way I can see it working is:
|
If no one else is working on this, I can take this up. |
No one assigned, should i start working on it ? |
go for it |
From what I can understand this task is majorly in the frontend, is there an issue this links to the Jaeger-ui repo? |
also, @charconstpointer Do you by any chance have the otel collector exported file with you? Will help me replicate and implement this feature. |
No, I have nothing that I'm allowed to share with a wider audience. |
|
There already exists endpoints such as '4317' in Jager Backend that can accept OTLP traces right? There would not be a need for conversion if the frontend can figure out what kind of trace it is and send it to the right port in the backend. Or do we want to handle this in the backend instead by calling the right functions to convert Jaeger traces to OTLP ones? |
Endpoints in the backend are stateful, they accept traces and store them in the storage backend. This is not what's needed here - the UI needs to call a stateless conversion service that does not store the trace, but returns it in a different format. |
Ah! That makes sense, I think I have a grip on the issue now and I went through the code a fair bit and found And just to mention, I'd like to work on this issue :) |
yes, it would be part of cmd/query. I'd say it can be part of the /api that the UI calls, like /api/transform |
Do you have anything in mind as to how to send the file content across to the backend at least concerning the http endpoint? |
Http post. UI already does it for Archive button. |
This is the format changes in thinking of : request-> JSON (OTLP) -> PROTOBUF (OTLP) --[using otlp2jaeger package]-> PROTOBUF (jaeger) -> JSON(jaeger) -> response So I've been trying to convert a protobuf encoded as JSON coming in through HTTP. While doing so I read the OTLP specification in which it mentioned that the OTLP/JSON deviates wrt to I found this code to handle this sort of unmarshalling in the protobuf : // UnmarshalJSON inflates trace id from hex string, possibly enclosed in quotes.
// Called by Protobuf JSON deserialization.
func (tid *TraceID) UnmarshalJSON(data []byte) error {
// in base64 encoding a 16-byte array is padded to 18 bytes
buf := [traceIDSize + 2]byte{}
if err := unmarshalJSON(buf[:], data); err != nil {
return err
}
*tid = [traceIDSize]byte{}
copy(tid[:], buf[:traceIDSize])
return nil
} But as per my calculations, this is what I find : 16-byte array will take up 32 characters of hex (as seen in JSON). These 32 characters will take up 192 bits (as base 64 is represented using 6 bits) which is 24 byte array and not 18. Please help me out if I'm mistaken here. |
You need to use code from otel-collector to both unmarshal JSON and to conver it into Jaeger model/*. Then use Jaeger model/converter/json/ |
So I've gotten the traces in []model.Batch format, I'm confused as to what the front end can handle, an []mode. Span or an []model.Trace (I assume the input file can have many traces and hence we cannot just simply merge all of them into a single array of span). Converting a model.batch to model.Trace is causing a bit of an issue as Process type doesn't convert to ProcessMap type if we try json marshalling and unmarshalling which eventually causes issues on the json.fromDomain() function. Would it be okay to define a function on model.Batch name |
If you have an HTTP endpoint that can accept OTLP, then you can use OTEL's code to convert it to Jaeger model, and then use this method in query's http_handler
|
@NavinShrinivas, are you still working on this one? |
Yes, i am still actively trying to solve this issue |
So @yurishkuro I have some updates on this issue, Currently this is the state on the backend : The function I wrote to convert a model.batch to model.Trace looks like this : func (m *Batch)ConvertToTraces()(*Trace){
ret_trace := Trace{}
ret_trace.Spans = m.Spans
for _,v := range ret_trace.Spans{
v.Process = m.Process
}
ret_trace.ProcessMap = append(ret_trace.ProcessMap, Trace_ProcessMapping{
ProcessID: m.Process.ServiceName,
Process: *m.Process,
})
return &ret_trace
} This fixed the issues I was having regarding |
Please create a draft PR, it's not efficient to discuss small snippets. |
Signed-off-by: Navin Shrinivas <karupal2002@gmail.com> partial work for issue jaegertracing#4949
Hey also, for the frontend, is there any particular way you have in mind for checking if the uploaded is otlp or jaeger. I was thinking of checking the existence |
sounds reasonable |
So I have been working on the front end, took me a while to understand the code base, I am adding a middleware to trigger API calls when needed to keep redux reducers "side effect" free. I'll make a draft PR soon. |
…5155) ## Which problem is this PR solving? * Solves #4949 * In combination with jaegertracing/jaeger-ui#2145 ## Description of the changes - Incorporates changes from previous draft PR review - Adds middleware in frontend as well ## How was this change tested? - Unit tests and supplying valid and invalid OTLP traces using insomnia to test the API ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Navin Shrinivas <karupal2002@gmail.com> Signed-off-by: Yuri Shkuro <github@ysh.us> Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> Co-authored-by: Yuri Shkuro <github@ysh.us>
## Which problem is this PR solving? - Part of jaegertracing/jaeger#4949 ## Description of the changes - Adds a redux middleware to make API calls to convert OTLP traces to jaeger traces when uploaded ## How was this change tested? - Unit test have been written, but apart form that OTLP traces were fed into the frontend (when compiled using all-in-one) to get correct behabiour ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Navin Shrinivas <karupal2002@gmail.com> Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
resolved |
What happened?
I'm running OTel Collector with one of the exporters exporting traces to a file via https://opentelemetry.io/docs/specs/otel/protocol/file-exporter/
Jaeger is running with
COLLECTOR_OTLP_ENABLED: true
When trying to import this data to a Jaeger UI via
![Screenshot 2023-11-14 at 12 27 43](https://private-user-images.githubusercontent.com/35968924/282760297-9b9428e6-4c40-4b49-aff3-5f778e602710.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg4ODE5NTgsIm5iZiI6MTcxODg4MTY1OCwicGF0aCI6Ii8zNTk2ODkyNC8yODI3NjAyOTctOWI5NDI4ZTYtNGM0MC00YjQ5LWFmZjMtNWY3NzhlNjAyNzEwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIwVDExMDczOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJjYjkzYmE1MWYyNzU1ZWFjNjM1YTE4Yjc4ZGU0OGI3OGEwODI0NGMxZmUyYjliM2YxZjVmYjE4NTA4ZmMyMzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.2jW0ptSEOU-khR018dw-2qwj8Z-nM7M9jTxIQ55fxVI)
I'm getting
Steps to reproduce
Expected behavior
To have my parses interpreted correctly as it happens with any other OTLP ingestion
Relevant log output
There was an error querying for traces: Error parsing JSON: Unexpected non-whitespace character after JSON at position 9465 (line 2 column 1)
Screenshot
No response
Additional context
No response
Jaeger backend version
1.50
SDK
Pipeline
OTel SDK -> OTel Collector -> file -> Jaeger manual import via UI
Stogage backend
a file
Operating system
Linux
Deployment model
k8s
Deployment configs
receivers: otlp: protocols: grpc: exporters: file: path: "/tmp/otel-output.json" processors: service: pipelines: traces: receivers: [otlp] processors: [] exporters: [file]
The text was updated successfully, but these errors were encountered: