-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add microsoft application insights as a supported trace datastore exa…
…mples (#2692) * save commit * feature: Azure Application Insights Datastore Integration * feature(examples): adding azure examples * feature(examples): adding azure examples * feature(examples): adding azure examples
- Loading branch information
Showing
38 changed files
with
14,887 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
INSTRUMENTATION_KEY="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
config.yaml | ||
node_modules |
10 changes: 10 additions & 0 deletions
10
examples/tracetest-azure-app-insights-collector/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM node:slim | ||
WORKDIR /usr/src/app | ||
|
||
COPY ./src/package*.json ./ | ||
|
||
RUN npm install | ||
COPY ./src . | ||
|
||
EXPOSE 8080 | ||
CMD [ "npm", "start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Tracetest + OTel Collector + Azure Application Insights (using the OpenTelemetry Collector) | ||
|
||
> [Read the detailed recipe for setting up Tracetest + OTel Collector + Azure Application Insights (using the OpenTelemetry Collector) in our documentation.](https://docs.tracetest.io/examples-tutorials/recipes/running-tracetest-with-azure-app-insights-otel-collector) | ||
This repository objective is to show how you can configure your Tracetest instance using the OpenTelemetry collector to send telemetry data to both Azure App Insights and the Tracetest. | ||
|
||
## Steps | ||
|
||
1. [Install the tracetest CLI](https://docs.tracetest.io/installing/) | ||
2. Run `tracetest configure --endpoint http://localhost:11633` on a terminal | ||
3. Update the `.env` file adding a valid set the valid App Insights Instrumentation Key | ||
4. Run the project by using docker-compose: `docker compose -f ./docker-compose.yaml -f ./tracetest/docker-compose.yaml up -d` | ||
5. Test if it works by running: `tracetest test run -d tests/test.yaml`. This would trigger a test that will send spans to Azure Monitor API and directly to Tracetest that is running on your machine. |
26 changes: 26 additions & 0 deletions
26
examples/tracetest-azure-app-insights-collector/collector.config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
http: | ||
|
||
processors: | ||
batch: | ||
|
||
exporters: | ||
azuremonitor: | ||
instrumentation_key: ${INSTRUMENTATION_KEY} | ||
otlp/tracetest: | ||
endpoint: tracetest:4317 | ||
tls: | ||
insecure: true | ||
|
||
service: | ||
pipelines: | ||
traces/tracetest: | ||
receivers: [otlp] | ||
processors: [batch] | ||
exporters: [otlp/tracetest] | ||
traces/appinsights: | ||
receivers: [otlp] | ||
exporters: [azuremonitor] |
17 changes: 17 additions & 0 deletions
17
examples/tracetest-azure-app-insights-collector/docker-compose.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: "3" | ||
services: | ||
app: | ||
build: . | ||
ports: | ||
- "8080:8080" | ||
otel-collector: | ||
image: otel/opentelemetry-collector-contrib:latest | ||
command: | ||
- "--config" | ||
- "/otel-local-config.yaml" | ||
volumes: | ||
- ./collector.config.yaml:/otel-local-config.yaml | ||
environment: | ||
INSTRUMENTATION_KEY: ${INSTRUMENTATION_KEY} | ||
ports: | ||
- 4317:4317 |
28 changes: 28 additions & 0 deletions
28
examples/tracetest-azure-app-insights-collector/src/app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const express = require("express"); | ||
const app = express(); | ||
const https = require("https"); | ||
|
||
app.get("/", (req, res) => { | ||
setTimeout(() => { | ||
res.send("Hello World"); | ||
}, 1000); | ||
}); | ||
|
||
app.get("/http-request/", (req, res) => { | ||
const endpoint = "https://www.microsoft.com/"; | ||
https.get(endpoint, (response) => { | ||
response.on("data", () => {}); | ||
|
||
response.on("error", (err) => { | ||
res.send(`Encountered error while making HTTPS request: ${err}`); | ||
}); | ||
|
||
response.on("end", () => { | ||
res.send(`Successfully reached ${endpoint}.`); | ||
}); | ||
}); | ||
}); | ||
|
||
app.listen(8080, () => { | ||
console.log(`Listening for requests on http://localhost:8080`); | ||
}); |
Oops, something went wrong.