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

Ingester: bridge OpenTracing spans to Otel #8242

Merged
merged 4 commits into from
Jun 7, 2024
Merged

Ingester: bridge OpenTracing spans to Otel #8242

merged 4 commits into from
Jun 7, 2024

Conversation

bboreham
Copy link
Contributor

@bboreham bboreham commented May 31, 2024

What this PR does

Set things up so we can see spans and events created inside Prometheus under QueryStream and QueryExemplars.

The bridge added in #2707 works when Prometheus creates a new Otel span, but when Prometheus calls SpanFromContext we need to have already set up a link from the current OpenTracing span to Otel.

As preparation, move the tracing bridge to its own package so we can call it without creating circular dependencies.

Example difference in output - top span is from an ingester without this PR and bottom span is with:

image

Checklist

  • Tests updated.
  • NA Documentation added.
  • CHANGELOG.md updated.
  • NA about-versioning.md updated with experimental features.

@bboreham
Copy link
Contributor Author

Maybe I should do this here?

func NewWithLogger(ctx context.Context, logger log.Logger, method string, kvps ...interface{}) (*SpanLogger, context.Context) {

@bboreham bboreham force-pushed the bridge-span branch 2 times, most recently from 3f41231 to 8ad8a7e Compare June 3, 2024 15:07
So we can call it without creating circular dependencies.
So we see spans and events inside Prometheus.

The bridge added in #2704 works when Prometheus creates a new Otel span,
but when Prometheus calls `SpanFromContext` we need to have already set
up a link from the current OpenTracing span to Otel.
Copy link
Contributor

@56quarters 56quarters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Maybe I should do this here?

Since we're just trying to improve ingester traces, that makes sense to me. The way we create spans across the codebase is kinda all over the place.

@pracucci
Copy link
Collaborator

pracucci commented Jun 7, 2024

I think we can merge as is, and consider doing it in the spanlogger in the future.

@pracucci pracucci merged commit e8a7d4c into main Jun 7, 2024
29 checks passed
@pracucci pracucci deleted the bridge-span branch June 7, 2024 06:03
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

Successfully merging this pull request may close these issues.

3 participants