-
Notifications
You must be signed in to change notification settings - Fork 73
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
feat: support opensearch as a tracing backend #1087
Conversation
server/traces/traces.go
Outdated
@@ -16,6 +16,50 @@ type Trace struct { | |||
Flat map[trace.SpanID]*Span `json:"-"` | |||
} | |||
|
|||
func NewTrace(traceID string, spans ...Span) Trace { |
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'll add a card to our backlog so we use this method instead of building the trace manually when converting from the otel format.
ef552ae
to
8945b7b
Compare
I deleted the existing tracing backend tests because:
|
@@ -115,8 +114,7 @@ func (pe DefaultPollerExecutor) donePollingTraces(job *PollingRequest, trace tra | |||
return false | |||
} | |||
|
|||
// We always expect to get the tracetest trigger span, so it has to have more than 1 span |
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.
This is only true if the user configures tracetest to send the triggering span to the same data store as its application. So, to prevent infinite loops, I reverted the len() > 1
condition-
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.
LGTM. Left a few nit comments
@@ -168,4 +184,59 @@ services: | |||
condition: service_healthy | |||
jaeger: | |||
condition: service_healthy | |||
networks: | |||
- local | |||
|
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.
Is this really needed? it's usually easier to let defaults do their thing
server/traces/traces.go
Outdated
@@ -16,6 +16,50 @@ type Trace struct { | |||
Flat map[trace.SpanID]*Span `json:"-"` | |||
} | |||
|
|||
func NewTrace(traceID string, spans ...Span) Trace { |
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.
This can be named New
, so the calls look like traces.New(...)
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.
Also, it looks easier to pass a []Span
than to expand an array on every call. I wouldn't expect it to be called with a manual list of Span
s
server/traces/traces.go
Outdated
span.Attributes["tracetest.span.duration"] = getSpanDuration(*span) | ||
} | ||
|
||
func getSpanDuration(span Span) string { |
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'd rename this to spanDuration
so it's consistent with spanType
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.
We already have a spanDuration
function right now here. I can rename it when I refactor the way we convert from OTEL to a trace.
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 renamed the older function. We will delete it anyway in a near future
This PR adds support for opensearch as a tracing backend.
Checklist