Skip to content

Instantly share code, notes, and snippets.

View jaycdave88's full-sized avatar

Jay C. Davé jaycdave88

View GitHub Profile
$TRACE_ID=($RANDOM % 1000000)
$SPAN_ID=($RANDOM % 1000000)
$START=$(date +%s%N)
sleep 2
$DURATION=$(($(date +%s%N) - $START))
$headers = @{"Content-Type" = "application/json"}
$url = "http://localhost:8126/v0.3/traces"
$parm = @{"trace_id"=$TRACE_ID; "span_id"=$SPAN_ID; "name"='azuretest'; "resource"='/home'; "service"='none';
"type"='web'; "start"=$START; "duration"=$DURATION }
image:
repository: datadog/agent
tag: latest
pullPolicy: IfNotPresent
nameOverride: ""
fullnameOverride: ""
datadog:
apiKey: xxx
appKey: xxx
name: datadog
@RequestMapping
public @ResponseBody String coffeeHouseIndex() {
if (GlobalTracer.get() != null && GlobalTracer.get().activeSpan() != null) {
try {
GlobalTracer.get().activeSpan();
if (setPriority.get() == null) {
setPriority.compareAndSet(null, GlobalTracer.get().activeSpan().getClass().getDeclaredMethod("setSamplingPriority", int.class));
}
setPriority.get().invoke(GlobalTracer.get().activeSpan(), 2 );
} catch(Exception e) {
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: basket
spec:
paused: true
template:
metadata:
labels:
app: eshop
@jaycdave88
jaycdave88 / Datadog_AspNetCore_APM_CMD_Batch.cmd
Last active November 4, 2020 20:19
Run Windows Desktop application script
rem Set environment variables
SET CORECLR_ENABLE_PROFILING=1
SET CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
SET CORECLR_PROFILER_PATH=%PROGRAMFILES%\Datadog\.NET Tracer\Datadog.Trace.ClrProfiler.Native.dll
SET DD_INTEGRATIONS=%PROGRAMFILES%\Datadog\.NET Tracer\integrations.json
SET DD_DOTNET_TRACER_HOME=%PROGRAMFILES%\Datadog\.NET Tracer
rem Start application
dotnet.exe example.dll
custom_metrics:
- name: sqlserver.buffer.page_lookups
counter_name: Page lookups/sec
- name: sqlserver.buffer.page_reads
counter_name: Page reads/sec
- name: sqlserver.workload.queued_requests
counter_name: Queued Requests
#!/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
@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
@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"')
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