npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@qq-framework/datadog

v2.0.2

Published

Projeto Datadog das Lojas Quero-Quero

Readme

Passos para utilização do Datadog

1 - Adicionar variaveis de ambiente no .env

...

# DATADOG
DD_ENV = "hml";
DD_AGENT_HOST = "myhost.com";
DD_LOGS_INJECTION = "true";

Para ativar o datadog é necessário a variável DD_TRACE_ON="true".

ATENÇÃO - Em homologação vamos usar somente via necessidade. Os recursos do Datadog são limitados e compartilhados com produção

2 - Instalar dependências

| Release | Node.js | | :---------------------------: | :------: | | @qq-framework/datadog 1.x.x | >= v14 | | @qq-framework/datadog 2.x.x | >= v18 |

| Release | Node.js | NestJS | | :--------------------: | :------: | :------: | | nestjs-ddtrace 3.x.x | >= v14 | >= v9 | | nestjs-ddtrace 4.x.x | >= v18 | >= v10 |

3 - Adicionar importação no app.module.ts

import { Module } from "@nestjs/common";
import { DatadogTraceModule } from "nestjs-ddtrace";

setEnv();

@Module({
  imports: [
    ...
    DatadogTraceModule.forRoot({ controllers: true, providers: true }),
    ...
  ],
})
export class AppModule {}

4 - Criar o arquivo tracing.ts dentro do src

import { tracerInit } from "@qq-framework/datadog";
import { setEnv } from "config";
import * as process from "process";

setEnv();

const tracer = tracerInit({
    traceOn: process.env.DD_TRACE_ON,
    env: process.env.DD_ENV,
    service: process.env.npm_package_name,
    hostname: process.env.DD_AGENT_HOST,
});

export default tracer;

5 - Adicionar importação no arquivo main

...
import "./tracing";

...

6 - Alterar a versão do package.json

A versão da aplicação utilizada nos filtros do Datadog é a versão do package.json. Caso deseje setar como varíavel de ambiente existe o campo version em tracerInit.

{
    "name": "example-app",
    "version": "1.0.4"
}

7 - Adicionar no script de deploy do Kubernetes as variáveis

No arquivo ci/k8s/prd/*.yml adicionar os campos de env e não no job do Jenkins.

---
#----------------------------------------------------------------------------------

# ---- SERVICE_NAME_EXAMPLE ----

#----------------------------------------------------------------------------------

apiVersion: apps/v1
kind: Deployment
metadata:
    name: SERVICE_NAME_EXAMPLE
    namespace: SERVICE_NAME_EXAMPLE
    labels:
        app: SERVICE_NAME_EXAMPLE
spec:
    selector:
        matchLabels:
            app: SERVICE_NAME_EXAMPLE
    replicas: 2
    revisionHistoryLimit: 3
    template:
        metadata:
            labels:
                app: SERVICE_NAME_EXAMPLE
        spec:
            imagePullSecrets:
                - name: mercantil
            containers:
                - name: SERVICE_NAME_EXAMPLE
                  env:
                      - name: DD_SERVICE
                        value: "SERVICE_NAME_EXAMPLE"
                      - name: DD_TRACE_ON
                        value: "true"
                      - name: DD_AGENT_HOST
                        valueFrom:
                            fieldRef:
                                fieldPath: status.hostIP
                      - name: DD_ENV
                        value: "prod"
                  image: my.container.registry.com/SERVICE_NAME_EXAMPLE:TAG_TO_REPLACE
                  imagePullPolicy: IfNotPresent
                  command: ["npm"]
                  args:
                      - run
                      - k8
                  startupProbe:
                      periodSeconds: 30
                      failureThreshold: 6 # Max re-tries
                      httpGet:
                          port: 3000
                          path: /HELLO_ROUTE
                  livenessProbe:
                      periodSeconds: 60
                      initialDelaySeconds: 60
                      httpGet:
                          port: 3000
                          path: /HELLO_ROUTE
                  resources:
                      requests:
                          cpu: 200m
                          memory: 256Mi
                      limits:
                          cpu: "1"
                          memory: "1Gi"

---
# ---- On Demand K8s ----

# ---- Sets the creation or deletion of replicas when CPU or Memory Utilization reaches a threshold

apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
    name: SERVICE_NAME_EXAMPLE
    labels:
        app: SERVICE_NAME_EXAMPLE
    namespace: SERVICE_NAME_EXAMPLE
spec:
    scaleTargetRef:
        apiVersion: apps/v1
        kind: Deployment
        name: SERVICE_NAME_EXAMPLE
    minReplicas: 2
    maxReplicas: 8
    metrics:
        - type: Resource
          resource:
              name: cpu
              target:
                  type: Utilization
                  averageUtilization: 300
        - type: Resource
          resource:
              name: memory
              target:
                  type: Utilization
                  averageUtilization: 300

---
# ---- Service creation ----

apiVersion: v1
kind: Service
metadata:
    name: SERVICE_NAME_EXAMPLE
    namespace: SERVICE_NAME_EXAMPLE
spec:
    selector:
        app: SERVICE_NAME_EXAMPLE
    type: LoadBalancer
    externalIPs:
        - 10.0.0.1
    ports:
        - protocol: TCP
          port: 3000
          targetPort: 3000

---