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

Setting dbmPropagationMode doesn't seem to work #31

Open
MorenoMdz opened this issue May 24, 2024 · 0 comments
Open

Setting dbmPropagationMode doesn't seem to work #31

MorenoMdz opened this issue May 24, 2024 · 0 comments

Comments

@MorenoMdz
Copy link

Hey there, we have been using DD with this package for over an year, we are running it with the latest version, but now we found an issue where the dbmPropagationMode setting is not working.

We have it set at our tracing.ts file

import tracer from 'dd-trace'
import { getEnvironment } from './utils'
export const getDDEnvVar = () => {
  const runningEnv = getEnvironment() !== 'production' ? 'dev' : 'production'
  return process.env.DD_ENV ?? runningEnv
}

const isPorter = !!process.env.PORTER_APP_SERVICE_NAME

if (isPorter) {
  tracer.init({
    logInjection: true,
    profiling: true,
    env: getDDEnvVar(),
    version: process.env.PORTER_POD_IMAGE_TAG ?? 'local',
    runtimeMetrics: true,
    dbmPropagationMode: 'full',
  })
} else {
  //Keep legacy for Render
  tracer.init({
    // https://docs.datadoghq.com/tracing/connect_logs_and_traces/nodejs/
    hostname: process.env.DD_AGENT_HOST_NAME ?? 'localhost',
    port: 8126,
    logInjection: true,
    profiling: true,
    env: getDDEnvVar(),
    version: process.env.RENDER_GIT_BRANCH ?? 'local',
    runtimeMetrics: true,
    dbmPropagationMode: 'full',
  })
}
export default tracer

Note: we need to support two different providers

This is the setting:
https://docs.datadoghq.com/database_monitoring/connect_dbm_and_apm/?tab=nodejs&site=us5

But notice how it is not enabled in the dd config init:

{
    "date": "2024-05-24T15:20:43.474Z",
    "os_name": "Linux",
    "os_version": "5.15.154+",
    "architecture": "x64",
    "version": "5.14.1",
    "lang": "nodejs",
    "lang_version": "20.10.0",
    "env": "porter-dev",
    "service": "traba-server-node",
    "agent_url": "http://10.129.0.57:8126/",
    "debug": false,
    "sampling_rules": [],
    "tags": {
        "service": "traba-server-node",
        "env": "porter-dev",
        "version": "latest",
        "runtime-id": "58310bd9-b04b-4a7a-9899-1c832561157d"
    },
    "dd_version": "latest",
    "log_injection_enabled": true,
    "runtime_metrics_enabled": true,
    "profiling_enabled": true,
    "integrations_loaded": [
        "fetch",
        "child_process",
        "net",
        "dns",
        "http",
        "winston",
        "http2",
        "aws-sdk",
        "ioredis",
        "amqplib",
        "openai",
        "express",
        "grpc"
    ],
    "appsec_enabled": false
}

We also tried enabling it using an Env, no luck.

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

No branches or pull requests

1 participant