You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@heap-dk/datadog-log-standard-attribute-types

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@heap-dk/datadog-log-standard-attribute-types

Typescript types for datadog log context standard attributes

1.2.0
latest
Source
npmnpm
Version published
Maintainers
2
Created
Source

datadog-log-standard-attribute-types

This module exposes Typescript types for Datadog's default standard attribute list for structured logging.

Assembled from data from:

  • https://docs.datadoghq.com/logs/log_collection/?tab=serverless#attributes-and-tags
  • https://docs.datadoghq.com/logs/processing/attributes_naming_convention/#default-standard-attribute-list

Installation

npm install --save-dev @heap-dk/datadog-log-standard-attribute-types

Usage

import { DD_META_STRUCTURE } from '@heap-dk/datadog-log-standard-attribute-types';

// See https://docs.datadoghq.com/logs/log_collection/?tab=host#logging-endpoints
const DD_API_URL = new URL(`https://http-intake.logs.datadoghq.eu/v1/input`);

function myDatadogLogger(message: string, context: DD_META_STRUCTURE) {
    fetch(API_URL.toString(), {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'DD-API-KEY': DD_API_KEY,
        },
        body: JSON.stringify({
            ...context,
            message,
        }),
  })
}

LICENSE

MIT

Keywords

typescript

FAQs

Package last updated on 23 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts