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

instrumentation-grpc doesn't seem to get initialized with --require @opentelemetry/auto-instrumentations-node/register #5301

Open
dudo opened this issue Jan 4, 2025 · 0 comments
Labels
bug Something isn't working triage

Comments

@dudo
Copy link

dudo commented Jan 4, 2025

What happened?

grpc (and others, but I'm especially concerned with grpc) traces aren't being emitted. Calls are successful, but no trace is emitted, and no context (or baggage) is propagated. Incoming http and dns traces are present, so it seems isolated some instrumentation.

I'm using modules and passing --require as an argument to node.

Here's a repo reproducing the problem:

https://github.com/gitops-ci-cd/acme-node/blob/main/package.json#L7

Simply run

docker compose watch

then visit http://localhost:8080/api/v1/hello.

OpenTelemetry Setup Code

OTEL_LOG_LEVEL=debug
OTEL_TRACES_EXPORTER=console
OTEL_METRICS_EXPORTER=none
OTEL_LOGS_EXPORTER=none
OTEL_SERVICE_NAME=acme-node
OTEL_NODE_RESOURCE_DETECTORS=env,host,os,process,serviceinstance,container
OTEL_NODE_ENABLED_INSTRUMENTATIONS=dns,http,express,grpc

package.json

No response

Relevant log output

Loading instrumentation for @opentelemetry/instrumentation-dns
Loading instrumentation for @opentelemetry/instrumentation-express
Loading instrumentation for @opentelemetry/instrumentation-grpc
Loading instrumentation for @opentelemetry/instrumentation-http
OpenTelemetry automatic instrumentation started successfully
...
@opentelemetry/instrumentation-http Applying instrumentation patch for nodejs core module on require hook { module: 'http' }
@opentelemetry/instrumentation-dns Applying instrumentation patch for nodejs core module on require hook { module: 'dns' }

I see hooks for http and dns, but none for grpc (or even express, which I'm using)

Operating System and Version

OSDetectorSync found resource. Resource {
  _attributes: { 'os.type': 'linux', 'os.version': '6.10.14-linuxkit' },
  asyncAttributesPending: false,
  _syncAttributes: { 'os.type': 'linux', 'os.version': '6.10.14-linuxkit' },
  _asyncAttributesPromise: undefined
}

Runtime and Version

Running via docker.

ProcessDetectorSync found resource. Resource {
  _attributes: {
    'process.pid': 18,
    'process.executable.name': 'node',
    'process.executable.path': '/usr/local/bin/node',
    'process.command_args': [
      '/usr/local/bin/node',
      '--require',
      '@opentelemetry/auto-instrumentations-node/register',
      '/usr/src/app/src/index.js'
    ],
    'process.runtime.version': '22.12.0',
    'process.runtime.name': 'nodejs',
    'process.runtime.description': 'Node.js',
    'process.command': '/usr/src/app/src/index.js',
    'process.owner': 'root'
  },
  asyncAttributesPending: false,
  _syncAttributes: {
    'process.pid': 18,
    'process.executable.name': 'node',
    'process.executable.path': '/usr/local/bin/node',
    'process.command_args': [
      '/usr/local/bin/node',
      '--require',
      '@opentelemetry/auto-instrumentations-node/register',
      '/usr/src/app/src/index.js'
    ],
    'process.runtime.version': '22.12.0',
    'process.runtime.name': 'nodejs',
    'process.runtime.description': 'Node.js',
    'process.command': '/usr/src/app/src/index.js',
    'process.owner': 'root'
  },
  _asyncAttributesPromise: undefined
}
@dudo dudo added bug Something isn't working triage labels Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant