docs: update onboarding docs (#3627)

Co-authored-by: ankit01-oss <>
This commit is contained in:
Ankit Anand 2023-09-26 20:38:37 +05:30 committed by GitHub
parent a4a285c074
commit 4cc3ce224c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 413 additions and 515 deletions

View File

@ -143,7 +143,7 @@ From VMs, there are two ways to send data to SigNoz Cloud.
`OTEL_EXPORTER_OTLP_HEADERS`: `signoz-access-token=<SIGNOZ-INGESTION-TOKEN>`. Update `<SIGNOZ-INGESTION-TOKEN>` with the ingestion token provided by SigNoz
`OTEL_EXPORTER_OTLP_ENDPOINT`: ingest.{region}.signoz.cloud:443. Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary according to this table.
`OTEL_EXPORTER_OTLP_ENDPOINT`: ingest.{region}.signoz.cloud:443. Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary accordingly.
US - ingest.us.signoz.cloud:443 <br></br>
@ -295,7 +295,7 @@ You can find instructions to install OTel Collector binary [here](https://signoz
### Applications Deployed on Kubernetes
For Golang application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](/docs/tutorial/kubernetes-infra-metrics/).
For Golang application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](https://signoz.io/docs/tutorial/kubernetes-infra-metrics/).
Once you have set up OTel Collector agent, you can proceed with OpenTelemetry Golang instrumentation by following the below steps:

View File

@ -29,13 +29,13 @@ Step 2. Run your application
```bash
OTEL_RESOURCE_ATTRIBUTES=service.name=<app_name> \
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=SIGNOZ_INGESTION_KEY" \
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=<SIGNOZ_INGESTION_KEY>" \
OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.{region}.signoz.cloud:443 \
java -javaagent:$PWD/opentelemetry-javaagent.jar -jar <my-app>.jar
```
- `<app_name>` is the name for your application
- `SIGNOZ_INGESTION_KEY` is the API token provided by SigNoz. You can find your ingestion key from SigNoz cloud account details sent on your email.
- `<SIGNOZ_INGESTION_KEY>` is the API token provided by SigNoz. You can find your ingestion key from SigNoz cloud account details sent on your email.
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary according to this table.
@ -73,7 +73,7 @@ java -javaagent:$PWD/opentelemetry-javaagent.jar -jar <myapp>.jar
### Applications Deployed on Kubernetes
For Java application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](/docs/tutorial/kubernetes-infra-metrics/).
For Java application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](https://signoz.io/docs/tutorial/kubernetes-infra-metrics/).
Once you have set up OTel Collector agent, you can proceed with OpenTelemetry java instrumentation by following the below steps:

View File

@ -35,16 +35,16 @@ Step 3. Update `JAVA_OPTS` environment variable
Update `JAVA_OPTS` environment variable with configurations required to send data to SigNoz cloud in your configuration file.
```bash
JAVA_OPTS="-javaagent:/path/opentelemetry-javaagent.jar
JAVA_OPTS="-javaagent:/<path>/opentelemetry-javaagent.jar
-Dotel.exporter.otlp.endpoint=https://ingest.{region}.signoz.cloud:443
-Dotel.exporter.otlp.headers="signoz-access-token=SIGNOZ_INGESTION_KEY"
-Dotel.exporter.otlp.headers="signoz-access-token=<SIGNOZ_INGESTION_KEY>"
-Dotel.resource.attributes="service.name=<app_name>""
```
You need to replace the following things based on your environment:<br></br>
- `path` - Update it to the path of your downloaded Java JAR agent.<br></br>
- `<path>` - Update it to the path of your downloaded Java JAR agent.<br></br>
- `<app_name>` is the name for your application
- `SIGNOZ_INGESTION_KEY` is the API token provided by SigNoz. You can find your ingestion key from SigNoz cloud account details sent on your email.
- `<SIGNOZ_INGESTION_KEY>` is the API token provided by SigNoz. You can find your ingestion key from SigNoz cloud account details sent on your email.
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary according to this table.
@ -96,7 +96,7 @@ where,
### Applications Deployed on Kubernetes
For Java application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](/docs/tutorial/kubernetes-infra-metrics/).
For Java application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](https://signoz.io/docs/tutorial/kubernetes-infra-metrics/).
Once you have set up OTel Collector agent, you can proceed with OpenTelemetry java instrumentation by following the below steps:

View File

@ -27,13 +27,14 @@ wget https://github.com/open-telemetry/opentelemetry-java-instrumentation/releas
Step 2. Run your application
```bash
OTEL_RESOURCE_ATTRIBUTES=service.name=<app_name> \
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=SIGNOZ_INGESTION_KEY" \
OTEL_RESOURCE_ATTRIBUTES=service.name=<myapp> \
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=<SIGNOZ_INGESTION_KEY>" \
OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.{region}.signoz.cloud:443 \
java -javaagent:$PWD/opentelemetry-javaagent.jar -jar <my-app>.jar
java -javaagent:<path>/opentelemetry-javaagent.jar -jar <myapp>.jar
```
- `<app_name>` is the name for your application
- `SIGNOZ_INGESTION_KEY` is the API token provided by SigNoz. You can find your ingestion key from SigNoz cloud account details sent on your email.
- `<myapp>` is the name for your application
- `<path>` - update it to the path of your downloaded Java JAR agent
- `<SIGNOZ_INGESTION_KEY>` is the API token provided by SigNoz. You can find your ingestion key from SigNoz cloud account details sent on your email.
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary according to this table.
@ -59,17 +60,17 @@ wget https://github.com/open-telemetry/opentelemetry-java-instrumentation/releas
Step 2. Run your application<br></br>
```bash
java -javaagent:$PWD/opentelemetry-javaagent.jar -jar <myapp>.jar
java -javaagent:<path>/opentelemetry-javaagent.jar -jar <myapp>.jar
```
- `<myapp>` is the name of your application jar file
- In case you download `opentelemetry-javaagent.jar` file in different directory than that of the project, replace `$PWD` with the path of the otel jar file.
- `<myapp>` is the name of your application
- `<path>` - update it to the path of your downloaded Java JAR agent
---
### Applications Deployed on Kubernetes
For Java application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](/docs/tutorial/kubernetes-infra-metrics/).
For Java application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](https://signoz.io/docs/tutorial/kubernetes-infra-metrics/).
Once you have set up OTel Collector agent, you can proceed with OpenTelemetry java instrumentation by following the below steps:
@ -82,10 +83,10 @@ Once you have set up OTel Collector agent, you can proceed with OpenTelemetry ja
2. Run your application<br></br>
```bash
java -javaagent:$PWD/opentelemetry-javaagent.jar -jar <myapp>.jar
java -javaagent:<path>/opentelemetry-javaagent.jar -jar <myapp>.jar
```
- `<myapp>` is the name of your application jar file
- In case you download `opentelemetry-javaagent.jar` file in different directory than that of the project, replace `$PWD` with the path of the otel jar file.
- `<myapp>` is the name of your application
- `<path>` - update it to the path of your downloaded Java JAR agent
3. Make sure to dockerise your application along with OpenTelemetry instrumentation.

View File

@ -26,22 +26,21 @@ wget https://github.com/open-telemetry/opentelemetry-java-instrumentation/releas
Step 2. Enable the instrumentation agent and run your application
If you run your `.war` package by putting in `webapps` folder, just add `setenv.sh` in your Tomcat `bin` folder.
This should set these environment variables and start sending telemetry data to SigNoz Cloud.
If you run your `.war` package by putting in `webapps` folder, just add `setenv.sh` in your Tomcat `bin` folder. Inside the `setenv.sh` file, add the following environment variables:
```bash
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/path/to/opentelemetry-javaagent.jar"
export OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=SIGNOZ_INGESTION_KEY"
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/<path>/opentelemetry-javaagent.jar"
export OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=<SIGNOZ_INGESTION_KEY>"
export OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.{region}.signoz.cloud:443
export OTEL_RESOURCE_ATTRIBUTES=service.name=<app_name>
```
- `<app_name>` is the name for your application
- `SIGNOZ_INGESTION_KEY` is the API token provided by SigNoz. You can find your ingestion key from SigNoz cloud account details sent on your email.
- `<path>` - update it to the path of your downloaded Java JAR agent.
- `<SIGNOZ_INGESTION_KEY>` is the API token provided by SigNoz. You can find your ingestion key from SigNoz cloud account details sent on your email.
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary according to this table.
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary accordingly.
US - ingest.us.signoz.cloud:443 <br></br>
@ -70,16 +69,16 @@ This should set these environment variables and start sending telemetry data to
```bash
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/path/to/opentelemetry-javaagent.jar"
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/<path>/opentelemetry-javaagent.jar"
```
- path/to - Update it to the path of your downloaded Java JAR agent.
- `<path>` - Update it to the path of your downloaded Java JAR agent.
---
### Applications Deployed on Kubernetes
For Java application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](/docs/tutorial/kubernetes-infra-metrics/).
For Java application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](https://signoz.io/docs/tutorial/kubernetes-infra-metrics/).
Once you have set up OTel Collector agent, you can proceed with OpenTelemetry java instrumentation by following the below steps:
@ -96,11 +95,11 @@ Once you have set up OTel Collector agent, you can proceed with OpenTelemetry ja
This should set the environment variable and start sending telemetry data to SigNoz Cloud.
```bash
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/path/to/opentelemetry-javaagent.jar"
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/<path>/opentelemetry-javaagent.jar"
```
- path/to - Update it to the path of your downloaded Java JAR agent.
- `<path>` - Update it to the path of your downloaded Java JAR agent.
3. Make sure to dockerise your application along with OpenTelemetry instrumentation.
You can validate if your application is sending traces to SigNoz cloud by following the instructions [here](#validating-instrumentation-by-checking-for-traces).
You can validate if your application is sending traces to SigNoz cloud by following the instructions [here](https://signoz.io/docs/instrumentation/tomcat/#validating-instrumentation-by-checking-for-traces).

View File

@ -23,7 +23,7 @@ export default function Javascript({
}: {
activeStep: number;
}): JSX.Element {
const [selectedFrameWork, setSelectedFrameWork] = useState('nodejs');
const [selectedFrameWork, setSelectedFrameWork] = useState('express');
const [form] = Form.useForm();

View File

@ -1,213 +1,212 @@
## Requirements
Supported Versions
^4.0.0
## Send traces to SigNoz Cloud
Based on your application environment, you can choose the setup below to send traces to SigNoz Cloud.
### Application on VMs
From VMs, there are two ways to send data to SigNoz Cloud.
- [Send traces directly to SigNoz Cloud](#send-traces-directly-to-signoz-cloud)
- [Send traces via OTel Collector binary](#send-traces-via-otel-collector-binary) (recommended)
#### **Send traces directly to SigNoz Cloud**
Step 1. Install OpenTelemetry packages
```bash
npm install --save @opentelemetry/api@^1.4.1
npm install --save @opentelemetry/sdk-node@^0.39.1
npm install --save @opentelemetry/auto-instrumentations-node@^0.37.0
npm install --save @opentelemetry/exporter-trace-otlp-http@^0.39.1
```
Step 2. Create tracing.js file<br></br>
You need to configure the endpoint for SigNoz cloud in this file. You can find your ingestion key from SigNoz cloud account details sent on your email.
```js
// tracing.js
'use strict'
const process = require('process');
const opentelemetry = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
// do not set headers in exporterOptions, the OTel spec recommends setting headers through ENV variables
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#specifying-headers-via-environment-variables
// highlight-start
const exporterOptions = {
url: 'https://ingest.{region}.signoz.cloud:443/v1/traces'
}
// highlight-end
const traceExporter = new OTLPTraceExporter(exporterOptions);
const sdk = new opentelemetry.NodeSDK({
traceExporter,
instrumentations: [getNodeAutoInstrumentations()],
resource: new Resource({
// highlight-next-line
[SemanticResourceAttributes.SERVICE_NAME]: 'node_app'
})
});
// initialize the SDK and register with the OpenTelemetry API
// this enables the API to record telemetry
sdk.start()
// gracefully shut down the SDK on process exit
process.on('SIGTERM', () => {
sdk.shutdown()
.then(() => console.log('Tracing terminated'))
.catch((error) => console.log('Error terminating tracing', error))
.finally(() => process.exit(0));
});
```
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary according to this table.
US - ingest.us.signoz.cloud:443/v1/traces <br></br>
IN - ingest.in.signoz.cloud:443/v1/traces <br></br>
EU - ingest.eu.signoz.cloud:443/v1/traces <br></br>
Step 3. Run the application<br></br>
Make sure you set the `OTEL_EXPORTER_OTLP_HEADERS` env as follows
```bash
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=<SIGNOZ_INGESTION_KEY>" node -r ./tracing.js app.js
```
`SIGNOZ_INGESTION_KEY` is the API token provided by SigNoz. You can find your ingestion key from SigNoz cloud account details sent on your email.
---
#### **Send traces via OTel Collector binary**
OTel Collector binary helps to collect logs, hostmetrics, resource and infra attributes. It is recommended to install Otel Collector binary to collect and send traces to SigNoz cloud. You can correlate signals and have rich contextual data through this way.
You can find instructions to install OTel Collector binary [here](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/) in your VM. Once you are done setting up your OTel Collector binary, you can follow the below steps for instrumenting your Javascript application.
Step 1. Install OpenTelemetry packages
```js
npm install --save @opentelemetry/api@^1.4.1
npm install --save @opentelemetry/sdk-node@^0.39.1
npm install --save @opentelemetry/auto-instrumentations-node@^0.37.0
npm install --save @opentelemetry/exporter-trace-otlp-http@^0.39.1
```
Step 2. Create tracing.js file<br></br>
```js
// tracing.js
'use strict'
const process = require('process');
const opentelemetry = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const exporterOptions = {
url: process.env.OTEL_EXPORTER_OTLP_ENDPOINT || 'http://localhost:4318/v1/traces',
}
const traceExporter = new OTLPTraceExporter(exporterOptions);
const sdk = new opentelemetry.NodeSDK({
traceExporter,
instrumentations: [getNodeAutoInstrumentations()],
resource: new Resource({
// highlight-next-line
[SemanticResourceAttributes.SERVICE_NAME]: 'node_app'
})
});
// initialize the SDK and register with the OpenTelemetry API
// this enables the API to record telemetry
sdk.start()
// gracefully shut down the SDK on process exit
process.on('SIGTERM', () => {
sdk.shutdown()
.then(() => console.log('Tracing terminated'))
.catch((error) => console.log('Error terminating tracing', error))
.finally(() => process.exit(0));
});
```
Step 3. Run the application<br></br>
```bash
node -r ./tracing.js app.js
```
---
### Applications Deployed on Kubernetes
For Javascript application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](/docs/tutorial/kubernetes-infra-metrics/).
Once you have set up OTel Collector agent, you can proceed with OpenTelemetry Javascript instrumentation by following the below steps:
Step 1. Install OpenTelemetry packages
```bash
npm install --save @opentelemetry/api@^1.4.1
npm install --save @opentelemetry/sdk-node@^0.39.1
npm install --save @opentelemetry/auto-instrumentations-node@^0.37.0
npm install --save @opentelemetry/exporter-trace-otlp-http@^0.39.1
```
Step 2. Create tracing.js file<br></br>
```js
// tracing.js
'use strict'
const process = require('process');
const opentelemetry = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const exporterOptions = {
url: process.env.OTEL_EXPORTER_OTLP_ENDPOINT || 'http://localhost:4318/v1/traces',
}
const traceExporter = new OTLPTraceExporter(exporterOptions);
const sdk = new opentelemetry.NodeSDK({
traceExporter,
instrumentations: [getNodeAutoInstrumentations()],
resource: new Resource({
// highlight-next-line
[SemanticResourceAttributes.SERVICE_NAME]: 'node_app'
})
});
// initialize the SDK and register with the OpenTelemetry API
// this enables the API to record telemetry
sdk.start()
// gracefully shut down the SDK on process exit
process.on('SIGTERM', () => {
sdk.shutdown()
.then(() => console.log('Tracing terminated'))
.catch((error) => console.log('Error terminating tracing', error))
.finally(() => process.exit(0));
});
```
Step 3. Run the application<br></br>
```bash
node -r ./tracing.js app.js
## Requirements
Supported Versions
^4.0.0
## Send traces to SigNoz Cloud
Based on your application environment, you can choose the setup below to send traces to SigNoz Cloud.
### Application on VMs
From VMs, there are two ways to send data to SigNoz Cloud.
- [Send traces directly to SigNoz Cloud](#send-traces-directly-to-signoz-cloud)
- [Send traces via OTel Collector binary](#send-traces-via-otel-collector-binary) (recommended)
#### **Send traces directly to SigNoz Cloud**
Step 1. Install OpenTelemetry packages
```bash
npm install --save @opentelemetry/api@^1.4.1
npm install --save @opentelemetry/sdk-node@^0.39.1
npm install --save @opentelemetry/auto-instrumentations-node@^0.37.0
npm install --save @opentelemetry/exporter-trace-otlp-http@^0.39.1
```
Step 2. Create tracing.js file<br></br>
You need to configure the endpoint for SigNoz cloud in this file. You also need to configure your service name. In this example, we have used `node_app`.
```js
// tracing.js
'use strict'
const process = require('process');
const opentelemetry = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
// do not set headers in exporterOptions, the OTel spec recommends setting headers through ENV variables
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#specifying-headers-via-environment-variables
const exporterOptions = {
url: 'https://ingest.{region}.signoz.cloud:443/v1/traces'
}
const traceExporter = new OTLPTraceExporter(exporterOptions);
const sdk = new opentelemetry.NodeSDK({
traceExporter,
instrumentations: [getNodeAutoInstrumentations()],
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'node_app'
})
});
// initialize the SDK and register with the OpenTelemetry API
// this enables the API to record telemetry
sdk.start()
// gracefully shut down the SDK on process exit
process.on('SIGTERM', () => {
sdk.shutdown()
.then(() => console.log('Tracing terminated'))
.catch((error) => console.log('Error terminating tracing', error))
.finally(() => process.exit(0));
});
```
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary according to this table.
US - ingest.us.signoz.cloud:443/v1/traces <br></br>
IN - ingest.in.signoz.cloud:443/v1/traces <br></br>
EU - ingest.eu.signoz.cloud:443/v1/traces <br></br>
Step 3. Run the application<br></br>
Make sure you set the `OTEL_EXPORTER_OTLP_HEADERS` env as follows
```bash
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=<SIGNOZ_INGESTION_KEY>" node -r ./tracing.js app.js
```
`<SIGNOZ_INGESTION_KEY>` is the API token provided by SigNoz. You can find your ingestion key from SigNoz cloud account details sent on your email.
---
#### **Send traces via OTel Collector binary**
OTel Collector binary helps to collect logs, hostmetrics, resource and infra attributes. It is recommended to install Otel Collector binary to collect and send traces to SigNoz cloud. You can correlate signals and have rich contextual data through this way.
You can find instructions to install OTel Collector binary [here](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/) in your VM. Once you are done setting up your OTel Collector binary, you can follow the below steps for instrumenting your Javascript application.
Step 1. Install OpenTelemetry packages
```js
npm install --save @opentelemetry/api@^1.4.1
npm install --save @opentelemetry/sdk-node@^0.39.1
npm install --save @opentelemetry/auto-instrumentations-node@^0.37.0
npm install --save @opentelemetry/exporter-trace-otlp-http@^0.39.1
```
Step 2. Create tracing.js file<br></br>
You need to configure your service name. In this example, we have used `node_app`.
```js
// tracing.js
'use strict'
const process = require('process');
const opentelemetry = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const exporterOptions = {
url: process.env.OTEL_EXPORTER_OTLP_ENDPOINT || 'http://localhost:4318/v1/traces',
}
const traceExporter = new OTLPTraceExporter(exporterOptions);
const sdk = new opentelemetry.NodeSDK({
traceExporter,
instrumentations: [getNodeAutoInstrumentations()],
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'node_app'
})
});
// initialize the SDK and register with the OpenTelemetry API
// this enables the API to record telemetry
sdk.start()
// gracefully shut down the SDK on process exit
process.on('SIGTERM', () => {
sdk.shutdown()
.then(() => console.log('Tracing terminated'))
.catch((error) => console.log('Error terminating tracing', error))
.finally(() => process.exit(0));
});
```
Step 3. Run the application<br></br>
```bash
node -r ./tracing.js app.js
```
---
### Applications Deployed on Kubernetes
For Javascript application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](https://signoz.io/docs/tutorial/kubernetes-infra-metrics/).
Once you have set up OTel Collector agent, you can proceed with OpenTelemetry Javascript instrumentation by following the below steps:
Step 1. Install OpenTelemetry packages
```bash
npm install --save @opentelemetry/api@^1.4.1
npm install --save @opentelemetry/sdk-node@^0.39.1
npm install --save @opentelemetry/auto-instrumentations-node@^0.37.0
npm install --save @opentelemetry/exporter-trace-otlp-http@^0.39.1
```
Step 2. Create tracing.js file<br></br>
You also need to configure your service name. In this example, we have used `node_app`.
```js
// tracing.js
'use strict'
const process = require('process');
const opentelemetry = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const exporterOptions = {
url: process.env.OTEL_EXPORTER_OTLP_ENDPOINT || 'http://localhost:4318/v1/traces',
}
const traceExporter = new OTLPTraceExporter(exporterOptions);
const sdk = new opentelemetry.NodeSDK({
traceExporter,
instrumentations: [getNodeAutoInstrumentations()],
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'node_app'
})
});
// initialize the SDK and register with the OpenTelemetry API
// this enables the API to record telemetry
sdk.start()
// gracefully shut down the SDK on process exit
process.on('SIGTERM', () => {
sdk.shutdown()
.then(() => console.log('Tracing terminated'))
.catch((error) => console.log('Error terminating tracing', error))
.finally(() => process.exit(0));
});
```
Step 3. Run the application<br></br>
```bash
node -r ./tracing.js app.js
```

View File

@ -26,7 +26,7 @@ npm install --save @opentelemetry/exporter-trace-otlp-http@^0.39.1
Step 2. Create tracing.js file<br></br>
You need to configure the endpoint for SigNoz cloud in this file. You can find your ingestion key from SigNoz cloud account details sent on your email.
You need to configure the endpoint for SigNoz cloud in this file. You also need to configure your service name. In this example, we have used `node_app`.
```js
// tracing.js
@ -41,18 +41,15 @@ const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventi
// do not set headers in exporterOptions, the OTel spec recommends setting headers through ENV variables
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#specifying-headers-via-environment-variables
// highlight-start
const exporterOptions = {
url: 'https://ingest.{region}.signoz.cloud:443/v1/traces'
}
// highlight-end
const traceExporter = new OTLPTraceExporter(exporterOptions);
const sdk = new opentelemetry.NodeSDK({
traceExporter,
instrumentations: [getNodeAutoInstrumentations()],
resource: new Resource({
// highlight-next-line
[SemanticResourceAttributes.SERVICE_NAME]: 'node_app'
})
});
@ -86,7 +83,7 @@ Make sure you set the `OTEL_EXPORTER_OTLP_HEADERS` env as follows
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=<SIGNOZ_INGESTION_KEY>" node -r ./tracing.js app.js
```
`SIGNOZ_INGESTION_KEY` is the API token provided by SigNoz. You can find your ingestion key from SigNoz cloud account details sent on your email.
`<SIGNOZ_INGESTION_KEY>` is the API token provided by SigNoz. You can find your ingestion key from SigNoz cloud account details sent on your email.
---
@ -107,6 +104,8 @@ npm install --save @opentelemetry/exporter-trace-otlp-http@^0.39.1
Step 2. Create tracing.js file<br></br>
You need to configure your service name. In this example, we have used `node_app`.
```js
// tracing.js
'use strict'
@ -126,7 +125,6 @@ const sdk = new opentelemetry.NodeSDK({
traceExporter,
instrumentations: [getNodeAutoInstrumentations()],
resource: new Resource({
// highlight-next-line
[SemanticResourceAttributes.SERVICE_NAME]: 'node_app'
})
});
@ -154,7 +152,7 @@ node -r ./tracing.js app.js
### Applications Deployed on Kubernetes
For Javascript application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](/docs/tutorial/kubernetes-infra-metrics/).
For Javascript application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](https://signoz.io/docs/tutorial/kubernetes-infra-metrics/).
Once you have set up OTel Collector agent, you can proceed with OpenTelemetry Javascript instrumentation by following the below steps:
@ -169,6 +167,8 @@ npm install --save @opentelemetry/exporter-trace-otlp-http@^0.39.1
Step 2. Create tracing.js file<br></br>
You need to configure your service name. In this example, we have used `node_app`.
```js
// tracing.js
'use strict'
@ -188,7 +188,6 @@ const sdk = new opentelemetry.NodeSDK({
traceExporter,
instrumentations: [getNodeAutoInstrumentations()],
resource: new Resource({
// highlight-next-line
[SemanticResourceAttributes.SERVICE_NAME]: 'node_app'
})
});

View File

@ -28,12 +28,11 @@ npm install --save @opentelemetry/exporter-trace-otlp-http@^0.39.1
Step 2. Create `tracer.ts` file<br></br>
You need to configure the endpoint for SigNoz cloud in this file.
You need to configure the endpoint for SigNoz cloud in this file. You also need to configure your service name. In this example, we have used `sampleNestjsApplication`.
```js
'use strict'
const process = require('process');
//OpenTelemetry
const opentelemetry = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
@ -41,9 +40,7 @@ const {Resource} = require('@opentelemetry/resources');
const {SemanticResourceAttributes} = require('@opentelemetry/semantic-conventions');
const exporterOptions = {
// highlight-start
url: 'https://ingest.{region}.signoz.cloud:443/v1/traces'
// highlight-end
}
const traceExporter = new OTLPTraceExporter(exporterOptions);
@ -70,7 +67,7 @@ const sdk = new opentelemetry.NodeSDK({
module.exports = sdk
```
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary according to this table.
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary accordingly.
US - ingest.us.signoz.cloud:443/v1/traces <br></br>
@ -80,7 +77,7 @@ Depending on the choice of your region for SigNoz cloud, the ingest endpoint wil
Step 3. Import the tracer module where your app starts
Step 3. Import the tracer module where your app starts `(Ex —> main.ts)`
```jsx
const tracer = require('./tracer')
@ -89,7 +86,7 @@ const tracer = require('./tracer')
Step 4. Start the tracer<br></br>
In the `async function boostrap` section of the application code, initialize the tracer as follows:
In the `async function boostrap` section of the application code `(Ex —> In main.ts)`, initialize the tracer as follows:
```jsx
const tracer = require('./tracer')
@ -100,9 +97,7 @@ import { AppModule } from './app.module';
// OpenTelemetry automatic instrumentation must go here.
async function bootstrap() {
// highlight-start
await tracer.start();
//highlight-end
const app = await NestFactory.create(AppModule);
await app.listen(3001);
}
@ -117,7 +112,7 @@ OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=<SIGNOZ_INGESTION_KEY>" nest sta
You can now run your Nestjs application. The data captured with OpenTelemetry from your application should start showing on the SigNoz dashboard.
`SIGNOZ_INGESTION_KEY` is the API token provided by SigNoz. You can find your ingestion key from SigNoz cloud account details sent on your email.
`<SIGNOZ_INGESTION_KEY>` is the API token provided by SigNoz. You can find your ingestion key from SigNoz cloud account details sent on your email.
---
@ -138,6 +133,8 @@ npm install --save @opentelemetry/exporter-trace-otlp-http@^0.39.1
Step 2. Create `tracer.ts` file<br></br>
You need to configure your service name. In this example, we have used `sampleNestjsApplication`.
```js
'use strict'
const process = require('process');
@ -149,9 +146,7 @@ const {Resource} = require('@opentelemetry/resources');
const {SemanticResourceAttributes} = require('@opentelemetry/semantic-conventions');
const exporterOptions = {
// highlight-start
url: 'http://localhost:4318/v1/traces'
// highlight-end
}
const traceExporter = new OTLPTraceExporter(exporterOptions);
@ -198,9 +193,7 @@ import { AppModule } from './app.module';
// OpenTelemetry automatic instrumentation must go here.
async function bootstrap() {
// highlight-start
await tracer.start();
//highlight-end
const app = await NestFactory.create(AppModule);
await app.listen(3001);
}
@ -213,7 +206,7 @@ Step 5. Run the application
### Applications Deployed on Kubernetes
For Javascript application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](/docs/tutorial/kubernetes-infra-metrics/).
For Javascript application deployed on Kubernetes, you need to install OTel Collector agent in your k8s infra to collect and send traces to SigNoz Cloud. You can find the instructions to install OTel Collector agent [here](https://signoz.io/docs/tutorial/kubernetes-infra-metrics/).
Once you have set up OTel Collector agent, you can proceed with OpenTelemetry Javascript instrumentation by following the below steps:
@ -228,6 +221,8 @@ npm install --save @opentelemetry/exporter-trace-otlp-http@^0.39.1
Step 2. Create `tracer.ts` file<br></br>
You need to configure your service name. In this example, we have used `sampleNestjsApplication`.
```js
'use strict'
const process = require('process');
@ -239,9 +234,7 @@ const {Resource} = require('@opentelemetry/resources');
const {SemanticResourceAttributes} = require('@opentelemetry/semantic-conventions');
const exporterOptions = {
// highlight-start
url: 'http://localhost:4318/v1/traces'
// highlight-end
}
const traceExporter = new OTLPTraceExporter(exporterOptions);
@ -288,9 +281,7 @@ import { AppModule } from './app.module';
// OpenTelemetry automatic instrumentation must go here.
async function bootstrap() {
// highlight-start
await tracer.start();
//highlight-end
const app = await NestFactory.create(AppModule);
await app.listen(3001);
}

View File

@ -68,14 +68,14 @@ Step 4. Run your application
```bash
OTEL_RESOURCE_ATTRIBUTES=service.name=<service_name> \
OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.{region}.signoz.cloud:443" \
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=SIGNOZ_INGESTION_KEY" \
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=<SIGNOZ_INGESTION_KEY>" \
OTEL_EXPORTER_OTLP_PROTOCOL=grpc \
opentelemetry-instrument <your_run_command>
```
- `<service_name>` is the name of the service you want
- <your_run_command> can be `python3 app.py` or `python manage.py runserver --noreload`
- Replace `SIGNOZ_INGESTION_KEY` with the api token provided by SigNoz. You can find it in the email sent by SigNoz with your cloud account details.
- Replace `<SIGNOZ_INGESTION_KEY>` with the api token provided by SigNoz. You can find it in the email sent by SigNoz with your cloud account details.
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary according to this table.

View File

@ -59,14 +59,14 @@ Step 4. Run your application
```bash
OTEL_RESOURCE_ATTRIBUTES=service.name=<service_name> \
OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.{region}.signoz.cloud:443" \
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=SIGNOZ_INGESTION_KEY" \
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=<SIGNOZ_INGESTION_KEY>" \
OTEL_EXPORTER_OTLP_PROTOCOL=grpc \
opentelemetry-instrument <your_run_command>
```
- *`<service_name>`* is the name of the service you want
- *<your_run_command>* can be `python3 app.py` or `flask run`
- Replace `SIGNOZ_INGESTION_KEY` with the api token provided by SigNoz. You can find it in the email sent by SigNoz with your cloud account details.
- *<your_run_command>* can be `python3 app.py` or `gunicorn src.app -b 0.0.0.0:8001`
- Replace `<SIGNOZ_INGESTION_KEY>` with the api token provided by SigNoz. You can find it in the email sent by SigNoz with your cloud account details.
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary according to this table.

View File

@ -42,14 +42,14 @@ Step 4. Run your application
```bash
OTEL_RESOURCE_ATTRIBUTES=service.name=<service_name> \
OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.{region}.signoz.cloud:443" \
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=SIGNOZ_INGESTION_KEY" \
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=<SIGNOZ_INGESTION_KEY>" \
OTEL_EXPORTER_OTLP_PROTOCOL=grpc \
opentelemetry-instrument <your_run_command>
```
- *`<service_name>`* is the name of the service you want
- *<your_run_command>* can be `python3 app.py` or `python manage.py runserver --noreload`
- Replace `SIGNOZ_INGESTION_KEY` with the api token provided by SigNoz. You can find it in the email sent by SigNoz with your cloud account details.
- *<your_run_command>* can be `python3 app.py` or `uvicorn main:app --host localhost --port 5002`
- Replace `<SIGNOZ_INGESTION_KEY>` with the api token provided by SigNoz. You can find it in the email sent by SigNoz with your cloud account details.
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary according to this table.

View File

@ -42,14 +42,14 @@ Step 4. Run your application
```bash
OTEL_RESOURCE_ATTRIBUTES=service.name=<service_name> \
OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.{region}.signoz.cloud:443" \
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=SIGNOZ_INGESTION_KEY" \
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=<SIGNOZ_INGESTION_KEY>" \
OTEL_EXPORTER_OTLP_PROTOCOL=grpc \
opentelemetry-instrument <your_run_command>
```
- *`<service_name>`* is the name of the service you want
- *<your_run_command>* can be `python3 app.py` or `flask run`
- Replace `SIGNOZ_INGESTION_KEY` with the api token provided by SigNoz. You can find it in the email sent by SigNoz with your cloud account details.
- Replace `<SIGNOZ_INGESTION_KEY>` with the api token provided by SigNoz. You can find it in the email sent by SigNoz with your cloud account details.
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary according to this table.

View File

@ -33,13 +33,13 @@ Step 3. Run your application
```bash
OTEL_RESOURCE_ATTRIBUTES=service.name=<service_name> \
OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.{region}.signoz.cloud:443" \
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=SIGNOZ_INGESTION_KEY" \
OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=<SIGNOZ_INGESTION_KEY>" \
opentelemetry-instrument <your_run_command>
```
- *`<service_name>`* is the name of the service you want
- *`<your_run_command>`* can be `python3 app.py` or `flask run`
- Replace `SIGNOZ_INGESTION_KEY` with the api token provided by SigNoz. You can find it in the email sent by SigNoz with your cloud account details.
- Replace `<SIGNOZ_INGESTION_KEY>` with the api token provided by SigNoz. You can find it in the email sent by SigNoz with your cloud account details.
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary according to this table.

View File

@ -1,7 +1,5 @@
## Collect Application Logs from Log file in SigNoz cloud
If you dont already have a SigNoz cloud account, you can sign up [here](https://signoz.io/teams/).
- Add otel collector binary to your VM by following this [guide](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/).
- Add the filelog reciever to `config.yaml`.
@ -35,4 +33,5 @@ If you dont already have a SigNoz cloud account, you can sign up [here](https
- Now we can restart the otel collector so that new changes are applied.
- The log will be exported, if you add more lines to the log file it will be exported as well
- If there are no errors your logs will be visible on SigNoz UI.

View File

@ -1,70 +1,23 @@
## Collect Syslogs in SigNoz cloud
## Collect Docker Container Logs in SigNoz Cloud
### Setup Otel Collector as agent
- Clone this [repository](https://github.com/SigNoz/docker-container-logs)
- Add `config.yaml`
```yaml {22-26}
receivers:
filelog:
include: [/tmp/python.log]
start_at: beginning
operators:
- type: json_parser
timestamp:
parse_from: attributes.time
layout: '%Y-%m-%d,%H:%M:%S %z'
- type: move
from: attributes.message
to: body
- type: remove
field: attributes.time
processors:
batch:
send_batch_size: 10000
send_batch_max_size: 11000
timeout: 10s
exporters:
otlp:
endpoint: 'ingest.{region}.signoz.cloud:443'
tls:
insecure: false
headers:
'signoz-access-token': '<SIGNOZ_INGESTION_KEY>'
service:
pipelines:
logs:
receivers: [filelog]
processors: [batch]
exporters: [otlp/log]
```
- Update `otel-collector-config.yaml` and set the values of `<SIGNOZ_INGESTION_KEY>` and `{region}`.
````
Depending on the choice of your region for SigNoz cloud, the otlp endpoint will vary according to this table.
Depending on the choice of your region for SigNoz cloud, the ingest endpoint will vary accordingly.
| Region | Endpoint |
| ------ | -------------------------- |
| US | ingest.us.signoz.cloud:443 |
| IN | ingest.in.signoz.cloud:443 |
| EU | ingest.eu.signoz.cloud:443 |
US - ingest.us.signoz.cloud:443 <br></br>
* We will start our otel-collector container.
```bash
docker run -d --name signoz-host-otel-collector -p 2255:2255 --user root -v $(pwd)/config.yaml:/etc/otel/config.yaml signoz/signoz-otel-collector:0.79.0
````
IN - ingest.in.signoz.cloud:443 <br></br>
### Run logspout to collect docker container logs and send it to local otel collector.
EU - ingest.eu.signoz.cloud:443 <br></br>
Logspout helps in collecting Docker logs by connecting to Docker socket.
- Run logspout
- Start the containers
```bash
docker compose up -d
```
```bash
docker run --net=host --rm --name="logspout" \
--volume=/var/run/docker.sock:/var/run/docker.sock \
gliderlabs/logspout \
syslog+tcp://<host>:2255
```
- If there are no errors your logs will be exported and will be visible on the SigNoz UI.
For finding the right host for your SigNoz cluster please follow the guide [here](../install/troubleshooting.md#signoz-otel-collector-address-grid).
- If there are no errors your logs will be exported and will be visible on the SigNoz UI.

View File

@ -1,66 +1,58 @@
If you use fluentBit to collect logs in your stack with this tutotrial you will be able to send logs from fluentBit to SigNoz.
## Collect Logs Using FluentBit in SigNoz cloud
If you use fluentBit to collect logs in your stack, you will be able to send logs from fluentBit to SigNoz.
At SigNoz we use opentelemetry collector to recieve logs which supports the fluentforward protocol. So you can forward your logs from your fluentBit agent to opentelemetry collector using fluentforward protocol.
### Collect Logs Using FluentBit in SigNoz cloud
* Add otel collector binary to your VM by following this [guide](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/).
- Add otel collector binary to your VM by following this [guide](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/).
- Add fluentforward reciever to your `config.yaml`
* Add fluentforward reciever to your `config.yaml`
```yaml
receivers:
fluentforward:
endpoint: 0.0.0.0:24224
```
Here we have used port 24224 for listening in fluentforward protocol, but you can change it to a port you want.
You can read more about fluentforward receiver [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/fluentforwardreceiver).
```yaml
receivers:
fluentforward:
endpoint: 0.0.0.0:24224
```
* Modify your `config.yaml` and add the above receiver
```yaml {4}
service:
....
logs:
receivers: [otlp, fluentforward]
processors: [batch]
exporters: [otlp]
```
Here we have used port 24224 for listing in fluentforward protocol, but you can change it to a port you want.
You can read more about fluentforward receiver [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/fluentforwardreceiver).
* Add the following to your fluentBit config to forward the logs to otel collector.
```
[OUTPUT]
Name forward
Match *
Host localhost
Port 24224
```
In this config we are forwarding the logs to the otel collector which is listening on port 24224.
Also we are assuming that you are running the fluentBit binary on the host. If not, the value of `host` might change depending on your environment.
- Modify your `config.yaml` and add the above receiver
```yaml {4}
service:
....
logs:
receivers: [otlp, fluentforward]
processors: [batch]
exporters: [otlp]
```
- Change the fluentBit config to forward the logs to otel collector.
* Once you make this changes you can restart fluentBit and otel-binary, and you will be able to see the logs in SigNoz.
```
[INPUT]
Name dummy
Tag dummy.log
Dummy {"message": "mylog", "trace_id": "0000000000000000f4dbb3edd765f620", "span_id": "43222c2d51a7abe3"}
[OUTPUT]
Name forward
Match *
Host otel-collector-host
Port 24224
```
In this example we are generating sample logs and then forwarding them to the otel collector which is listening on port 24224.
`otel-collector-host` has to be replaced by the host where otel-collector is running. For more info check [troubleshooting](../install/troubleshooting.md#signoz-otel-collector-address-grid).
- Once you make this changes you can restart fluentBit and otel-binary, and you will be able to see the logs in SigNoz.
- To properly transform your existing log model into opentelemetry [log](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md) model you can use the different processors provided by opentelemetry. [link](./logs.md#processors-available-for-processing-logs)
eg:-
```yaml
processors:
logstransform:
operators:
- type: trace_parser
trace_id:
parse_from: attributes.trace_id
span_id:
parse_from: attributes.span_id
- type: remove
field: attributes.trace_id
- type: remove
field: attributes.span_id
```
The operations in the above processor will parse the trace_id and span_id from log to opentelemetry log model and remove them from attributes.
* To properly transform your existing log model into opentelemetry [log](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md) model you can use the different processors provided by opentelemetry. ([link](https://signoz.io/docs/userguide/logs/#processors-available-for-processing-logs))
eg:-
```yaml
processors:
logstransform:
operators:
- type: trace_parser
trace_id:
parse_from: attributes.trace_id
span_id:
parse_from: attributes.span_id
- type: remove
field: attributes.trace_id
- type: remove
field: attributes.span_id
```
The operations in the above processor will parse the trace_id and span_id from log to opentelemetry log model and remove them from attributes.

View File

@ -1,24 +1,21 @@
If you use fluentD to collect logs in your stack with this tutotrial you will be able to send logs from fluentD to SigNoz.
## Collect Logs Using FluentD in SigNoz cloud
At SigNoz we use opentelemetry collector to recieve logs which supports the fluentforward protocol. So you can forward your logs from your fluentD agent to opentelemetry collector.
If you use fluentD to collect logs in your stack, you will be able to send logs from fluentD to SigNoz.
### Collect Logs Using FluentD in SigNoz cloud
At SigNoz, we use opentelemetry collector to recieve logs which supports the fluentforward protocol. So you can forward your logs from your fluentD agent to opentelemetry collector.
- Add otel collector binary to your VM by following this [guide](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/).
- Add fluentforward reciever to your `config.yaml`
* Add otel collector binary to your VM by following this [guide](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/).
* Add fluentforward reciever to your `config.yaml`
```yaml
receivers:
fluentforward:
endpoint: 0.0.0.0:24224
fluentforward:
endpoint: 0.0.0.0:24224
```
Here we have used port 24224 for listing in fluentforward protocol, but you can change it to a port you want.
Here we have used port 24224 for listening in fluentforward protocol, but you can change it to a port you want.
You can read more about fluentforward receiver [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/fluentforwardreceiver).
- Modify your `config.yaml` and add the above receiver
* Modify your `config.yaml` and add the above receiver
```yaml {4}
service:
....
@ -28,17 +25,9 @@ At SigNoz we use opentelemetry collector to recieve logs which supports the flue
exporters: [otlp]
```
- Change the fluentD config to forward the logs to otel collector.
* Add the following to your fluentD config to forward the logs to otel collector.
```
<source>
@type sample
sample [{"message": "my log data", "source": "myhost"}, {"message": "my log data 1", "source": "myhost1"}]
tag sample
rate 10000
</source>
<match sample>
<match <directive>>
@type forward
send_timeout 60s
recover_wait 10s
@ -46,34 +35,32 @@ At SigNoz we use opentelemetry collector to recieve logs which supports the flue
<server>
name myserver1
host otel-collector-host
host localhost
port 24224
</server>
</match>
```
In this config we are matching a directive and forwarding logs to the otel collector which is listening on port 24224. Replace `<directive>` with your directive name.
Also we are assuming that you are running the fluentD binary on the host. If not, the value of `host` might change depending on your environment.
* Once you make this changes you can restart fluentD and otel-binary, and you will be able to see the logs in SigNoz.
* To properly transform your existing log model into opentelemetry [log](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md) model you can use the different processors provided by opentelemetry. ([link](https://signoz.io/docs/userguide/logs/#processors-available-for-processing-logs))
In this example we are generating sample logs and then forwarding them to the otel collector which is listening on port 24224.
`otel-collector-host` has to be replaced by the host where otel-collector is running. For more info check [troubleshooting](../install/troubleshooting.md#signoz-otel-collector-address-grid).
eg:-
- Once you make this changes you can restart fluentD and otel-binary, and you will be able to see the logs in SigNoz.
```yaml
processors:
logstransform:
operators:
- type: trace_parser
trace_id:
parse_from: attributes.trace_id
span_id:
parse_from: attributes.span_id
- type: remove
field: attributes.trace_id
- type: remove
field: attributes.span_id
```
- To properly transform your existing log model into opentelemetry [log](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md) model you can use the different processors provided by opentelemetry. [link](./logs.md#processors-available-for-processing-logs)
eg:-
```yaml
processors:
logstransform:
operators:
- type: trace_parser
trace_id:
parse_from: attributes.trace_id
span_id:
parse_from: attributes.span_id
- type: remove
field: attributes.trace_id
- type: remove
field: attributes.span_id
```
The operations in the above processor will parse the trace_id and span_id from log to opentelemetry log model and remove them from attributes.
The operations in the above processor will parse the trace_id and span_id from log to opentelemetry log model and remove them from attributes.

View File

@ -1,12 +1,13 @@
If you use logstash to collect logs in your stack with this tutotrial you will be able to send logs from logstash to SigNoz.
## Collect Logs Using Logstash in SigNoz cloud
At SigNoz we use opentelemetry collector to recieve logs which supports the TCP protocol. So you can forward your logs from your logstash agent to opentelemetry collector
If you use logstash to collect logs in your stack, you will be able to send logs from Logstash to SigNoz.
## Steps to recieve logs from Logstash:
At SigNoz we use OpenTelemetry Collector to recieve logs which supports the TCP protocol. So you can forward your logs from the logstash agent to opentelemetry collector.
- Add fluentforward reciever to your `otel-collector-config.yaml` which is present inside `deploy/docker/clickhouse-setup`
* Add otel collector binary to your VM by following this [guide](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/).
```
* Add the reciever to your `config.yaml`
```yaml
receivers:
tcplog/logstash:
max_log_size: 1MiB
@ -16,47 +17,32 @@ At SigNoz we use opentelemetry collector to recieve logs which supports the TCP
add_attributes: false
operators: []
```
Here we have used port 2255 for listing in TCP protocol, but you can change it to a port you want.
Here we have used port 2255 for listening in TCP protocol, but you can change it to a port you want.
You can read more about tcplog reciver [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/tcplogreceiver).
- Update the pipleline for logs and make the following change in `otel-collector-config.yaml`
```
* Modify your `config.yaml` and add the above receiver
```yaml {4}
service:
...
logs:
receivers: [ otlp, tcplog/logstash ]
processors: [ batch ]
exporters: [ clickhouselogsexporter ]
....
logs:
receivers: [otlp, tcplog/logstash]
processors: [batch]
exporters: [otlp]
```
Here we are adding our clickhouse exporter and creating a pipeline which will collect logs from `tcplog/logstash` receiver, processing it using batch processor and export it to clickhouse.
- Expose the port in port for otel-collector in `docker-compose.yaml` file present in `deploy/docker/clickhouse-setup`
```
otel-collector:
...
ports:
- "2255:2255"
```
- Change the logstash config to forward the logs to otel collector.
* Change the logstash config to forward the logs to otel collector.
```
output {
tcp {
codec => json_lines # this is required otherwise it will send eveything in a single line
host => "otel-collector-host"
host => "localhost"
port => 2255
}
}
```
Here we are configuring logstash to send logs to otel-collector that we ran in the previous step, which is listening on port 2255.
Also we are assuming that you are running the logstash binary on the host. If not, the value of `host` might change depending on your environment.
In this example we are generating sample logs and then forwarding them to the otel collector which is listening on port 2255.
`otel-collector-host` has to be replaced by the host where otel-collector is running. For more info check [troubleshooting](../install/troubleshooting.md#signoz-otel-collector-address-grid).
* Once you make this changes you can otel binary and logstash, and you will be able to see the logs in SigNoz.
- Once you make this changes you can restart logstash and SignNoz, and you will be able to see the logs in SigNoz.
- To properly transform your existing log model into opentelemetry [log](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md) model you can use the different processors provided by opentelemetry. [link](./logs.md#processors-available-for-processing-logs)
* To properly transform your existing log model into opentelemetry [log](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md) model you can use the different processors provided by opentelemetry ([link](https://signoz.io/docs/userguide/logs/#processors-available-for-processing-logs)).

View File

@ -1,6 +1,6 @@
## Collect Kubernetes Pod Logs in SigNoz Cloud
To collect logs from your kubernetes cluster, you will need to deploy k8s-infra chart. Please follow the guide [here](/docs/tutorial/kubernetes-infra-metrics/). Log collection of pods from all namespaces is enabled by default except for pods in `kube-system` and `hotrod`. To modify the log collection mechanism, please follow the guides below.
To collect logs from your kubernetes cluster, you will need to deploy k8s-infra chart. Please follow the guide [here](https://signoz.io/docs/tutorial/kubernetes-infra-metrics/). Log collection of pods from all namespaces is enabled by default except for pods in `kube-system` and `hotrod`. To modify the log collection mechanism, please follow the guides below.
- [Disable automatic pod logs collection](#steps-to-disable-automatic-pod-logs-collection)
- [Filter/Exclude logs collection](#steps-to-filterexclude-logs-collection)
- [Disable automatic pod logs collection](https://signoz.io/docs/userguide/collect_kubernetes_pod_logs/#steps-to-disable-automatic-pod-logs-collection)
- [Filter/Exclude logs collection](https://signoz.io/docs/userguide/collect_kubernetes_pod_logs/#steps-to-filterexclude-logs-collection)

View File

@ -35,16 +35,16 @@ const supportedLogTypes = [
id: 'application_logs_log_file',
imgURL: `Logos/software-window.svg`,
},
{
name: 'NodeJS Winston Logs ',
id: 'nodejs',
imgURL: `Logos/node-js.svg`,
},
{
name: 'Application Logs using OTEL SDK',
id: 'application_logs_otel_sdk',
imgURL: `Logos/cmd-terminal.svg`,
},
// {
// name: 'NodeJS Winston Logs ',
// id: 'nodejs',
// imgURL: `Logos/node-js.svg`,
// },
// {
// name: 'Application Logs using OTEL SDK',
// id: 'application_logs_otel_sdk',
// imgURL: `Logos/cmd-terminal.svg`,
// },
{
name: 'Logs from existing collectors',
id: 'existing_collectors',

View File

@ -1,11 +1,7 @@
## Collect Syslogs in SigNoz cloud
If you dont already have a SigNoz cloud account, you can sign up [here](https://signoz.io/teams/).
<Tabs>
<TabItem value="VM" label="VM" default>
- Add otel collector binary to your VM by following this [guide](https://signoz.io/docs/tutorial/opentelemetry-binary-usage-in-virtual-machine/).
- Add the syslog reciever to `config.yaml` to otel-collector.
```yaml {2-10}
@ -22,7 +18,7 @@ If you dont already have a SigNoz cloud account, you can sign up [here](https
```
Here we are collecting the logs and moving message from attributes to body using operators that are available.
You can read more about operators [here](./logs.md#operators-for-parsing-and-manipulating-logs).
You can read more about operators [here](https://signoz.io/docs/userguide/logs/#operators-for-parsing-and-manipulating-logs).
For more configurations that are available for syslog receiver please check [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/syslogreceiver).
@ -70,14 +66,10 @@ If you dont already have a SigNoz cloud account, you can sign up [here](https
action.resumeRetryCount="10"
queue.type="linkedList" queue.size="10000" template="UTCTraditionalForwardFormat")
```
So that you have retires and queue in place to de-couple the sending from the other logging action.
The value of `target` might vary depending on where SigNoz is deployed, since it is deployed on the same host I am using `0.0.0.0` for more help you can visit [here](../install/troubleshooting.md#signoz-otel-collector-address-grid).
So that you have retries and queue in place to de-couple the sending from other logging action. Also, we are assuming that you are running the otel binary on the same host. If not, the value of target might change depending on your environment.
- Now restart your rsyslog service by running `sudo systemctl restart rsyslog.service`
- You can check the status of service by running `sudo systemctl status rsyslog.service`
- If there are no errors your logs will be visible on SigNoz UI.
</TabItem>
</Tabs>
- You can check the status of service by running `sudo systemctl status rsyslog.service`
- If there are no errors your logs will be visible on SigNoz UI.