Skip to content

Instantly share code, notes, and snippets.

View jaycdave88's full-sized avatar

Jay C. Davé jaycdave88

View GitHub Profile
rem Set environment variables
SET COR_ENABLE_PROFILING=1
SET COR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
rem Start application
example.exe
@jaycdave88
jaycdave88 / PS_WinRegEdit_For_Datadog
Last active July 17, 2020 21:50
PoweShell command to update Windows Registry to enable App Analytics & trace_id injection for Datadog.
[String[]] $v = @("COR_ENABLE_PROFILING=1", "COR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}","CORECLR_ENABLE_PROFILING=1", "CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}", "DD_TRACE_ANALYTICS_ENABLED=true", "DD_AspNet_ENABLED=true", "DD_LOGS_INJECTION=true")
Set-ItemProperty HKLM:SYSTEM\CurrentControlSet\Services\W3SVC -Name Environment -Value $v
Set-ItemProperty HKLM:SYSTEM\CurrentControlSet\Services\WAS -Name Environment -Value $v
net stop was /y
net start w3svc
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using Datadog.Trace; //Adding the Datadog.Trace nuget package (https://www.nuget.org/packages/Datadog.Trace)
namespace BlobServiceAPI.Controllers
{
[Route("api/[controller]")]
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SETLOCAL ENABLEEXTENSIONS
ECHO Verifying installer package...
ECHO.
REM The value of this path will be changed during build to use the version stamped msi file.
SET msi_path="%~dp0AppDynamics\dotNetAgentSetup.msi"

Log Processing Rules

log_processing_rules:

Generic String: "sensitive-info"

  - type: exclude_at_match
    name: exclude_sensitive_info
    pattern: (?:sensitive\-info)
@jaycdave88
jaycdave88 / Helm chart for Datadog
Created March 5, 2020 22:26
Live process, Live container, Docker metrics, Kubernetes metrics, Kube state metrics, all logs, and the cluster agent
image:
repository: datadog/agent
tag: latest
pullPolicy: IfNotPresent
nameOverride: ""
fullnameOverride: ""
datadog:
apiKey: xxx
appKey: xxx
name: datadog
docker run -d -v ~/opt/couchbase/var/lib/couchbase/logs/*.log --restart always --name db -p 8091-8094:8091-8094 -p 11210:11210 -l com.datadoghq.ad.check_names='["couchbase"]' -l com.datadoghq.ad.init_configs='[{}]' -l com.datadoghq.ad.instances='[{"server":"http://%%host%%:8091","query_monitoring_url":"http://%%host%%:8093","username":"Administrator","password":"admin123"}]' -l com.datadoghq.ad.logs='[{"source":"couchbase", "service":"db"}]' couchbase
@jaycdave88
jaycdave88 / Datadog PowerShell + win32_event_log setup
Last active October 12, 2023 15:15
PowerShell script to install latest Datadog Windows agent. Enable logs, live process, and configure win32_event_logs
# Download agent
(Invoke-WebRequest https://s3.amazonaws.com/ddagent-windows-stable/datadog-agent-7-latest.amd64.msi -OutFile c:\datadog-agent-7-latest.amd64.msi)
# Download .NET Tracer v1.13x64 .msi
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
(Invoke-WebRequest https://github.com/DataDog/dd-trace-dotnet/releases/download/v1.13.0/datadog-dotnet-apm-1.13.0-x64.msi -OutFile c:\datadog-dotnet-apm-1.13.0-x64.msi)
# Start the Datadog agent
(Start-Process -Wait msiexec -ArgumentList '/qn /i c:\datadog-agent-7-latest.amd64.msi APIKEY=xxx HOSTNAME="my_hostname" TAGS="mytag1,mytag2"')
@jaycdave88
jaycdave88 / Datadog win32_event_log.d config
Created February 14, 2020 17:21
Agent config settings for win32_event_log.d - will provide logs & events
init_config:
instances:
- type:
- Information
- Critical
- Error
- Warning
- Information
- Audit Failure
- Audit Success
#!/bin/bash
# install the Datadog agent
DD_AGENT_MAJOR_VERSION=7 DD_API_KEY=xxx DD_TAGS="env:edp" DD_SITE="datadoghq.eu" bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/datadog-agent/master/cmd/agent/install_script.sh)"
# Enable logs and process
sudo sed -i '/# logs_enabled: false/a logs_enabled: true' /etc/datadog-agent/datadog.yaml
sudo sed -i '/# process_config:/a process_config:\n\ \ \enabled: "true"' /etc/datadog-agent/datadog.yaml
# Enable network