Skip to content

Conversation

AnmolxSingh
Copy link
Contributor

Which problem is this PR solving?

Description of the changes

  • jtracer replaced with otel collector tracer

How was this change tested?

Checklist

Signed-off-by: anmol7344 <[email protected]>
Copy link

codecov bot commented Oct 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.53%. Comparing base (d510cf5) to head (9de8fe1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7542      +/-   ##
==========================================
+ Coverage   96.49%   96.53%   +0.04%     
==========================================
  Files         385      385              
  Lines       23316    23303      -13     
==========================================
- Hits        22498    22496       -2     
+ Misses        629      621       -8     
+ Partials      189      186       -3     
Flag Coverage Δ
badger_v1 9.01% <ø> (ø)
badger_v2 1.59% <ø> (ø)
cassandra-4.x-v1-manual 11.67% <ø> (ø)
cassandra-4.x-v2-auto 1.58% <ø> (ø)
cassandra-4.x-v2-manual 1.58% <ø> (ø)
cassandra-5.x-v1-manual 11.67% <ø> (ø)
cassandra-5.x-v2-auto 1.58% <ø> (ø)
cassandra-5.x-v2-manual 1.58% <ø> (ø)
clickhouse 1.53% <ø> (ø)
elasticsearch-6.x-v1 16.56% <ø> (ø)
elasticsearch-7.x-v1 16.61% <ø> (ø)
elasticsearch-8.x-v1 16.75% <ø> (ø)
elasticsearch-8.x-v2 1.59% <ø> (ø)
elasticsearch-9.x-v2 1.59% <ø> (ø)
grpc_v1 10.21% <ø> (ø)
grpc_v2 1.59% <ø> (ø)
kafka-3.x-v1 9.66% <ø> (ø)
kafka-3.x-v2 1.59% <ø> (ø)
memory_v2 1.59% <ø> (ø)
opensearch-1.x-v1 16.65% <ø> (ø)
opensearch-2.x-v1 16.65% <ø> (ø)
opensearch-2.x-v2 1.59% <ø> (ø)
opensearch-3.x-v2 1.59% <ø> (ø)
query 1.59% <ø> (ø)
tailsampling-processor 0.43% <ø> (ø)
unittests 95.53% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: anmol7344 <[email protected]>
Signed-off-by: anmol7344 <[email protected]>
}

func newServer(config *Config, otel component.TelemetrySettings) *server {
func newServer(config *Config, telemetry component.TelemetrySettings) *server {
Copy link
Member

Choose a reason for hiding this comment

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

we use the name telset

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes I noticed it in V1 codebase my bad.

Copy link

github-actions bot commented Oct 5, 2025

Metrics Comparison Summary

Total changes across all snapshots: 53

Detailed changes per snapshot

summary_metrics_snapshot_cassandra

📊 Metrics Diff Summary

Total Changes: 53

  • 🆕 Added: 53 metrics
  • ❌ Removed: 0 metrics
  • 🔄 Modified: 0 metrics

🆕 Added Metrics

  • http_server_request_body_size_bytes (18 variants)
View diff sample
+http_server_request_body_size_bytes{http_request_method="GET",http_response_status_code="503",le="+Inf",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_request_body_size_bytes{http_request_method="GET",http_response_status_code="503",le="0",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_request_body_size_bytes{http_request_method="GET",http_response_status_code="503",le="10",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_request_body_size_bytes{http_request_method="GET",http_response_status_code="503",le="100",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_request_body_size_bytes{http_request_method="GET",http_response_status_code="503",le="1000",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_request_body_size_bytes{http_request_method="GET",http_response_status_code="503",le="10000",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_request_body_size_bytes{http_request_method="GET",http_response_status_code="503",le="25",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
...
- `http_server_request_duration_seconds` (17 variants)
View diff sample
+http_server_request_duration_seconds{http_request_method="GET",http_response_status_code="503",le="+Inf",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_request_duration_seconds{http_request_method="GET",http_response_status_code="503",le="0.005",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_request_duration_seconds{http_request_method="GET",http_response_status_code="503",le="0.01",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_request_duration_seconds{http_request_method="GET",http_response_status_code="503",le="0.025",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_request_duration_seconds{http_request_method="GET",http_response_status_code="503",le="0.05",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_request_duration_seconds{http_request_method="GET",http_response_status_code="503",le="0.075",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_request_duration_seconds{http_request_method="GET",http_response_status_code="503",le="0.1",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
...
- `http_server_response_body_size_bytes` (18 variants)
View diff sample
+http_server_response_body_size_bytes{http_request_method="GET",http_response_status_code="503",le="+Inf",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_response_body_size_bytes{http_request_method="GET",http_response_status_code="503",le="0",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_response_body_size_bytes{http_request_method="GET",http_response_status_code="503",le="10",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_response_body_size_bytes{http_request_method="GET",http_response_status_code="503",le="100",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_response_body_size_bytes{http_request_method="GET",http_response_status_code="503",le="1000",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_response_body_size_bytes{http_request_method="GET",http_response_status_code="503",le="10000",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
+http_server_response_body_size_bytes{http_request_method="GET",http_response_status_code="503",le="25",network_protocol_name="http",network_protocol_version="1.1",otel_scope_name="go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",otel_scope_schema_url="",otel_scope_version="0.62.0",server_address="localhost",server_port="13133",url_scheme="http"}
...

➡️ View full metrics file

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

I don't see what this PR is changing, looks just cosmetic

@AnmolxSingh
Copy link
Contributor Author

AnmolxSingh commented Oct 6, 2025

I want to clarify — is it because JaegerQuery currently does not emit any spans?

My goal with this PR is to migrate to the OTEL collector tracer from jtracer, and I want to make sure I understand what would make this PR functional and non-cosmetic.

}
}(ctx)
// Getting Tracer from OTEL
tp = otel.GetTracerProvider()
Copy link
Member

Choose a reason for hiding this comment

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

you are not getting the tracer configured by OTEL collector, you're getting a global tracer, which may or may not be the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean i should define and configure the otel tracer here itself?
something like this?

res := resource.NewWithAttributes(
		semconv.SchemaURL,
		semconv.ServiceNameKey.String("jaeger-query"),
	)

exporter, err := otlptracegrpc.New(context.Background(),
    otlptracegrpc.WithEndpoint(endpoint),
    otlptracegrpc.WithInsecure(),
)
if err != nil {
   return fmt.Errorf("failed to create OTLP trace exporter", err)
}

tp := sdktrace.NewTracerProvider(
    sdktrace.WithBatcher(exporter),
    sdktrace.WithResource(res),
)

otel.SetTracerProvider(tp)

Copy link
Member

Choose a reason for hiding this comment

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

OTEL collector initializes all telemetry factories. The point of the ticket was that we shouldn't duplicate that initialization (which allows fewer customizations) and instead rely on the factories created by OTEL Collector framework.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

even i thought this (as it would just defy the purpose of the issue) i just wanted to clarify by asking as I got confused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was looking at the Collector code and found this in service/service.go:
https://github.com/open-telemetry/opentelemetry-collector/blob/3b5555471b93052c4fbe4ef412d974a999d1b27f/service/service.go#L169

It seems like Service.New() initializes the tracerProvider via the telemetry factory.
For this issue, should we use this TracerProvider in Jaeger Query, or is there a different factory we should be referencing?

Copy link
Member

Choose a reason for hiding this comment

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

We are already getting it via component.TelemetrySettings, so we should be using that's in there instead of creating our own. But we need to verify that we're getting the same traces in the end.

Signed-off-by: anmol7344 <[email protected]>
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

What testing have you done?

tp = jtracer.NoOp().OTEL
tp = noop.NewTracerProvider()

if s.config.EnableTracing {
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need this setting? Can it not be controlled from telemetry section of otel config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should it be removed from QueryOptions struct as well?

@AnmolxSingh
Copy link
Contributor Author

What testing have you done?

I believe that Jaeger Query does not emit spans with the current setup and if so should it be made to emit spans for testing purpose?

@yurishkuro
Copy link
Member

I believe that Jaeger Query does not emit spans with the current setup and if so should it be made to emit spans for testing purpose?

it always has, if you reload jaeger UI a few times you should see jaeger service in the dropdown. If not then something is broken.

@AnmolxSingh
Copy link
Contributor Author

if you reload jaeger UI a few times you should see jaeger service in the dropdown

Oh, I see! I was always running the Jaeger v1 all-in-one Docker image, so I hadn’t really never noticed the dropdown changes.

@AnmolxSingh
Copy link
Contributor Author

I tried testing Jaeger v2 locally by building the binary from cmd/jaeger, but it does not recognize the --config flag. I also didn’t see any reference to this in the documentation — it only mentions running v2 via YAML using the Docker image.
Could you clarify if local builds support YAML configuration, or would I need to make a docker image to test with a YAML file?

@yurishkuro
Copy link
Member

it makes no difference is you run a binary or docker image. Jaeger accepts --config parameter, the the examples of configs are in cmd/jaeger

@AnmolxSingh
Copy link
Contributor Author

it makes no difference is you run a binary or docker image

Oh sorry! Actually I misunderstood the error. I built Jaeger v2 from cmd/jaeger and tried to run it with config.yaml file but it fails due to some missing UI assets

ui assets not embedded in the binary, using a placeholder
error: open actual/index.html.gz: file does not exist

and

cannot read UI config file ./cmd/jaeger/config-ui.json

is there a make/generate step for embedding the UI into the binary when building locally?

@yurishkuro
Copy link
Member

make build-ui

@AnmolxSingh
Copy link
Contributor Author

Hi @yurishkuro
I wanted to update on the backend change I’ve been working on. I’ve tried testing it locally, but I’ve run into a blocker: the make build-ui step fails on my Windows machine due to Linux-specific build scripts and system limitations. As a result, I cannot run the backend with the UI locally to test end-to-end.

I’ve tried WSL and other options, but none worked in my environment. I understand from the scripts that Jaeger development is Linux-first. Given these constraints, could you advise the recommended workflow for contributors on Windows? Would it be acceptable to submit the backend change for review/testing on a Linux environment, or is there an alternative approach for testing?

Thank you for your guidance and time!

@yurishkuro
Copy link
Member

post the errors you're getting if you're asking for help.

did you initialize the ui submodule? the build-ui normally works by downloading the bundle from the release, you don't actually need to build anything.

@AnmolxSingh
Copy link
Contributor Author

did you initialize the ui submodule?

Ah! sorry for not posting the steps I performed earlier and thanks for the hint! I realized I hadn’t initialized the UI submodule, and after doing that, the make build-ui step worked as expected. I’m now able to run the backend with the UI locally.

@AnmolxSingh
Copy link
Contributor Author

AnmolxSingh commented Oct 10, 2025

I tested this pr and attaching the screenshots of the changes.

After changes from this pr

Screenshot 2025-10-10 141932

Even after refreshing several times I did not see Jaeger service in the dropdown.

Screenshot 2025-10-10 141907

Before changes from this pr

Screenshot 2025-10-10 141104

Jaeger service was always showing in the dropdown and showing traces even before sending traces from HotROD demo.

@AnmolxSingh
Copy link
Contributor Author

It seems this change currently breaks span collection for Jaeger service.

Steps to reproduce :-

  • run go build -o jaeger in the cmd/jaeger repo
  • run ./cmd/jaeger/jaeger --config=./cmd/jaeger/config.yaml from root folder
  • use the hotrod demo app for tracing

With this setup, I wasn't able to see spans being collected.

@yurishkuro
Copy link
Member

in main branch today:

$ JAEGER_VERSION=2.11.0 HOTROD_VERSION=1.74.0 docker compose up
image image

@AnmolxSingh
Copy link
Contributor Author

@yurishkuro
Yes, this is what I meant in my earlier message - before the changes from this PR, the jaeger service was showing up, but after applying the changes from this branch, it no longer appears. So it seems the changes aren’t working as expected.

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.

jtracer from Jaeger-V2 should be removed

2 participants