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

content length attributes not set when ignoreNetworkEvents is true #5229

Closed
arriIsHere opened this issue Dec 3, 2024 · 1 comment · Fixed by #5230
Closed

content length attributes not set when ignoreNetworkEvents is true #5229

arriIsHere opened this issue Dec 3, 2024 · 1 comment · Fixed by #5230
Labels
bug Something isn't working pkg:instrumentation-fetch priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect

Comments

@arriIsHere
Copy link
Contributor

What happened?

Steps to Reproduce

  1. Open the examples/opentelemetry-web/examples/fetchexample
  2. Start example
  3. Note that the GET event has a http.response_content_length attribute
  4. Add the ignoreNetworkEvents: true config to the FetchInstrumentation in the index.js file
  5. Run example
  6. Note that the GET event no longer has a http.response_content_length attribute

Expected Result

http.response_content_length attribute should still be present even if ignoreNetworkEvents is set to true

Actual Result

http.response_content_length is not present when ignoreNetworkEvents is set to true.

Additional Details

OpenTelemetry Setup Code

const provider = new WebTracerProvider({
  resource: new Resource({
    [SEMRESATTRS_SERVICE_NAME]: 'fetch-web-service'
  }),
  // Note: For production consider using the "BatchSpanProcessor" to reduce the number of requests
  // to your exporter. Using the SimpleSpanProcessor here as it sends the spans immediately to the
  // exporter without delay
  spanProcessors:[
    new SimpleSpanProcessor(new ConsoleSpanExporter()),
    new SimpleSpanProcessor(new OTLPTraceExporter()),
  ]
});

provider.register({
  contextManager: new ZoneContextManager(),
  propagator: new B3Propagator(),
});

registerInstrumentations({
  instrumentations: [
    new FetchInstrumentation({
      ignoreNetworkEvents: true,
      ignoreUrls: [/localhost:8090\/sockjs-node/],
      propagateTraceHeaderCorsUrls: [
        'https://cors-test.appspot.com/test',
        'https://httpbin.org/get',
      ],
      clearTimingResources: true,
    }),
  ],
});

const webTracerWithZone = provider.getTracer('example-tracer-web');

package.json

No response

Relevant log output

No response

Operating System and Version

Mac M3 Pro, macOS Sonoma 14.4

Runtime and Version

Node v18.20.4
Chrome v131.0.6778.86

@dyladan
Copy link
Member

dyladan commented Dec 4, 2024

Looks like this wasn't tracked before https://github.com/MustafaHaddara made #4706 @MustafaHaddara is there any way you can take a look at this?

@dyladan dyladan added priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect and removed triage labels Dec 4, 2024
@pichlermarc pichlermarc added triage pkg:instrumentation-fetch priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect and removed priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect triage labels Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:instrumentation-fetch priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
Projects
None yet
3 participants