Skip to content

Commit

Permalink
added node.js azure function example
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitchsplunk committed Dec 11, 2024
1 parent 1cccb71 commit 9ba7cce
Show file tree
Hide file tree
Showing 21 changed files with 2,667 additions and 12 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ This category includes examples that demonstrate how to instrument applications
with OpenTelemetry that use combinations of the following languages and target
deployment environments:

| Language / Environment | Java | .NET | Node.js | Python | Go |
|------------------------|------------------------------------------------|--------------------------------------------------|---------------------------------------------|---------------------------------------------|-----------------------------------------|
| Linux | [Link](./instrumentation/java/linux) | [Link](./instrumentation/dotnet/linux) | [Link](./instrumentation/nodejs/linux) | [Link](./instrumentation/python/linux) | [Link](./instrumentation/go/linux) |
| Windows | | | | | |
| Kubernetes | [Link](./instrumentation/java/k8s) | [Link](./instrumentation/dotnet/k8s) | [Link](./instrumentation/nodejs/k8s) | [Link](./instrumentation/python/k8s) | [Link](./instrumentation/go/k8s) |
| AWS ECS Fargate | [Link](./instrumentation/java/aws-ecs) | [Link](./instrumentation/dotnet/aws-ecs) | [Link](./instrumentation/nodejs/aws-ecs) | [Link](./instrumentation/python/aws-ecs) | [Link](./instrumentation/go/aws-ecs) |
| AWS EKS Fargate | [Link](./instrumentation/java/aws-eks-fargate) | | | | |
| AWS Lambda Function | [Link](./instrumentation/java/aws-lambda) | [Link](./instrumentation/dotnet/aws-lambda) | [Link](./instrumentation/nodejs/aws-lambda) | [Link](./instrumentation/python/aws-lambda) | [Link](./instrumentation/go/aws-lambda) |
| Azure Function | [Link](./instrumentation/java/azure-functions) | [Link](./instrumentation/dotnet/azure-functions) | | | |
| Google Cloud Function | | | | | |
| Azure Web Apps | | | | | |
| Language / Environment | Java | .NET | Node.js | Python | Go |
|------------------------|------------------------------------------------|--------------------------------------------------|--------------------------------------------------|---------------------------------------------|-----------------------------------------|
| Linux | [Link](./instrumentation/java/linux) | [Link](./instrumentation/dotnet/linux) | [Link](./instrumentation/nodejs/linux) | [Link](./instrumentation/python/linux) | [Link](./instrumentation/go/linux) |
| Windows | | | | | |
| Kubernetes | [Link](./instrumentation/java/k8s) | [Link](./instrumentation/dotnet/k8s) | [Link](./instrumentation/nodejs/k8s) | [Link](./instrumentation/python/k8s) | [Link](./instrumentation/go/k8s) |
| AWS ECS Fargate | [Link](./instrumentation/java/aws-ecs) | [Link](./instrumentation/dotnet/aws-ecs) | [Link](./instrumentation/nodejs/aws-ecs) | [Link](./instrumentation/python/aws-ecs) | [Link](./instrumentation/go/aws-ecs) |
| AWS EKS Fargate | [Link](./instrumentation/java/aws-eks-fargate) | | | | |
| AWS Lambda Function | [Link](./instrumentation/java/aws-lambda) | [Link](./instrumentation/dotnet/aws-lambda) | [Link](./instrumentation/nodejs/aws-lambda) | [Link](./instrumentation/python/aws-lambda) | [Link](./instrumentation/go/aws-lambda) |
| Azure Function | [Link](./instrumentation/java/azure-functions) | [Link](./instrumentation/dotnet/azure-functions) | [Link](./instrumentation/nodejs/azure-functions) | | |
| Google Cloud Function | | | | | |
| Azure Web Apps | | | | | |

Examples for each combination will be added over time.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions instrumentation/nodejs/azure-functions/.funcignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.js.map
*.ts
.git*
.vscode
__azurite_db*__.json
__blobstorage__
__queuestorage__
local.settings.json
test
tsconfig.json
99 changes: 99 additions & 0 deletions instrumentation/nodejs/azure-functions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TypeScript output
dist
out

# Azure Functions artifacts
bin
obj
appsettings.json
local.settings.json

# Azurite artifacts
__blobstorage__
__queuestorage__
__azurite_db*__.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"ms-azuretools.vscode-azurefunctions"
]
}
13 changes: 13 additions & 0 deletions instrumentation/nodejs/azure-functions/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Node Functions",
"type": "node",
"request": "attach",
"restart": true,
"port": 9229,
"preLaunchTask": "func: host start"
}
]
}
9 changes: 9 additions & 0 deletions instrumentation/nodejs/azure-functions/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"azureFunctions.deploySubpath": ".",
"azureFunctions.postDeployTask": "npm install (functions)",
"azureFunctions.projectLanguage": "JavaScript",
"azureFunctions.projectRuntime": "~4",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.projectLanguageModel": 4,
"azureFunctions.preDeployTask": "npm prune (functions)"
}
24 changes: 24 additions & 0 deletions instrumentation/nodejs/azure-functions/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "func",
"label": "func: host start",
"command": "host start",
"problemMatcher": "$func-node-watch",
"isBackground": true,
"dependsOn": "npm install (functions)"
},
{
"type": "shell",
"label": "npm install (functions)",
"command": "npm install"
},
{
"type": "shell",
"label": "npm prune (functions)",
"command": "npm prune --production",
"problemMatcher": []
}
]
}
Loading

0 comments on commit 9ba7cce

Please sign in to comment.