From a49f31373fad2e1e2bca8560857ae2cc89dab3cb Mon Sep 17 00:00:00 2001 From: Simplychee Date: Mon, 9 Oct 2023 13:40:32 +0300 Subject: [PATCH] changing ``` languages --- .../log-shipping/apprunner-defaults.md | 2 +- .../log-shipping/cloudwatch-defaults.md | 2 +- .../dotnet-framework-steps.md | 2 +- .../_include/tracing-shipping/dotnet-steps.md | 4 +- docs/shipping/Code/node-js.md | 42 +++++++++---------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/_include/log-shipping/apprunner-defaults.md b/docs/_include/log-shipping/apprunner-defaults.md index 27a3eaef..43142798 100644 --- a/docs/_include/log-shipping/apprunner-defaults.md +++ b/docs/_include/log-shipping/apprunner-defaults.md @@ -4,7 +4,7 @@ By default, we do not send logs of type START, END, REPORT. If you prefer to send all log types, replace the method `_parse_apprunner_log` in the Lambda function with the following: -```py +```python def _parse_apprunner_log(log, additional_data): # type: (dict, dict) -> bool _add_timestamp(log) diff --git a/docs/_include/log-shipping/cloudwatch-defaults.md b/docs/_include/log-shipping/cloudwatch-defaults.md index e6357471..77519bf4 100644 --- a/docs/_include/log-shipping/cloudwatch-defaults.md +++ b/docs/_include/log-shipping/cloudwatch-defaults.md @@ -4,7 +4,7 @@ By default, we do not send logs of type START, END, REPORT. If you prefer to send all log types, replace the method `_parse_cloudwatch_log` in the Lambda function with the following: -```py +``````python def _parse_cloudwatch_log(log, additional_data): # type: (dict, dict) -> bool _add_timestamp(log) diff --git a/docs/_include/tracing-shipping/dotnet-framework-steps.md b/docs/_include/tracing-shipping/dotnet-framework-steps.md index ad20144d..937c08ae 100644 --- a/docs/_include/tracing-shipping/dotnet-framework-steps.md +++ b/docs/_include/tracing-shipping/dotnet-framework-steps.md @@ -29,7 +29,7 @@ Add a required HttpModule to the Web.Config file as follows: Add the following code to the Global.asax.cs file: -```cs +```csharp using OpenTelemetry; using OpenTelemetry.Resources; using OpenTelemetry.Trace; diff --git a/docs/_include/tracing-shipping/dotnet-steps.md b/docs/_include/tracing-shipping/dotnet-steps.md index 8df2c243..edba24e2 100644 --- a/docs/_include/tracing-shipping/dotnet-steps.md +++ b/docs/_include/tracing-shipping/dotnet-steps.md @@ -13,14 +13,14 @@ dotnet add package OpenTelemetry.Extensions.Hosting Add the following configuration to the beginning of the Startup.cs file: -```cs +```csharp using OpenTelemetry.Resources; using OpenTelemetry.Trace; ``` Add the following configuration to the Startup class: -```cs +```csharp public void ConfigureServices(IServiceCollection services) { diff --git a/docs/shipping/Code/node-js.md b/docs/shipping/Code/node-js.md index 3fe5268a..4b1187e1 100644 --- a/docs/shipping/Code/node-js.md +++ b/docs/shipping/Code/node-js.md @@ -43,7 +43,7 @@ Use the samples in the code block below as a starting point, and replace the sam For a complete list of options, see the configuration parameters below the code block.πŸ‘‡ -```js +```javascript // Replace these parameters with your configuration var logger = require('logzio-nodejs').createLogger({ token: '<>', @@ -79,7 +79,7 @@ For more consistent and reliable parsing, we recommend sending logs as objects. To send an object (recommended): - ```js + ```javascript var obj = { message: 'Some log message', param1: 'val1', @@ -90,13 +90,13 @@ To send an object (recommended): To send raw text: - ```js + ```javascript logger.log('This is a log message'); ``` Include this line at the end of the run if you're using logzio-nodejs in a severless environment, such as AWS Lambda, Azure Functions, or Google Cloud Functions: - ```js + ```javascript logger.sendAndClose(); ``` @@ -104,7 +104,7 @@ Include this line at the end of the run if you're using logzio-nodejs in a sever You can add custom tags to your logs using the following format: `{ tags : ['tag1']}`, for example: -```js +```javascript var obj = { message: 'Your log message', @@ -143,7 +143,7 @@ npm install winston-logzio --save Here's a sample configuration that you can use as a starting point. Use the samples in the code block below or replace the sample with a configuration that matches your needs. -```js +```javascript const winston = require('winston'); const LogzioWinstonTransport = require('winston-logzio'); @@ -196,24 +196,24 @@ For a complete list of your options, see the configuration parameters below.πŸ‘‡ * If winston-logzio is used as part of a serverless service (AWS Lambda, Azure Functions, Google Cloud Functions, etc.), add this line at the end of the configuration code block. - ```js + ```javascript logger.close() ``` * The winston logger by default sends all logs to the console. You can easily disable this by adding this line to your code: - ```js + ```javascript winston.remove(winston.transports.Console); ``` * To send a log line: - ```js + ```javascript winston.log('info', 'winston logger configured with logzio transport'); ``` * To log the last UncaughtException before Node exits: - ```js + ```javascript var logzIOTransport = new (winstonLogzIO)(loggerOptions); var logger = new(winston.Logger)({ transports: [ @@ -235,7 +235,7 @@ For a complete list of your options, see the configuration parameters below.πŸ‘‡ * Another configuration option - ```js + ```javascript var winston = require('winston'); var logzioWinstonTransport = require('winston-logzio'); @@ -255,7 +255,7 @@ For a complete list of your options, see the configuration parameters below.πŸ‘‡ You can add custom tags to your logs using the following format: `{ tags : ['tag1']}`, for example: -```js +```javascript var obj = { message: 'Your log message', @@ -295,13 +295,13 @@ npm install winston-logzio --save If you don't have a `tsconfig.json` file, you'll need to add it first. Start by running: -```js +```javascript tsc --init ``` On your `tsconfig.json` file, under the parameter `compilerOptions` make sure you have the `esModuleInterop` flag set to `true` or add it: -```js +```javascript "compilerOptions": { ... "esModuleInterop": true @@ -311,7 +311,7 @@ On your `tsconfig.json` file, under the parameter `compilerOptions` make sure yo Here's a sample configuration that you can use as a starting point. Use the samples in the code block below or replace the sample with a configuration that matches your needs. -```js +```javascript import winston from 'winston'; import LogzioWinstonTransport from 'winston-logzio'; const logzioWinstonTransport = new LogzioWinstonTransport({ @@ -329,7 +329,7 @@ logger.log('warn', 'Just a test message'); If winston-logzio is used as part of a serverless service (AWS Lambda, Azure Functions, Google Cloud Functions, etc.), add this line at the end of the configuration code block, every time you are using the logger. -```js +```javascript await logger.info(β€œAPI Called”) logger.close() @@ -357,7 +357,7 @@ tsc --project tsconfig.json You can add custom tags to your logs using the following format: `{ tags : ['tag1']}`, for example: -```js +```javascript var obj = { message: 'Your log message', @@ -400,7 +400,7 @@ npm install logzio-nodejs-metrics-sdk@0.4.0 Add the following code to your application: -```js +```javascript const MeterProvider = require('@opentelemetry/sdk-metrics-base'); const sdk = require('logzio-nodejs-metrics-sdk'); @@ -441,7 +441,7 @@ To add a required metric to your code, copy and paste the required metric code t #### Counter -```js +```javascript // Create your first counter metric const requestCounter = meter.createCounter('Counter', { description: 'Example of a Counter', @@ -456,7 +456,7 @@ requestCounter.add(1,labels); #### UpDownCounter -```js +```javascript // Create UpDownCounter metric const upDownCounter = meter.createUpDownCounter('UpDownCounter', { description: 'Example of a UpDownCounter', @@ -472,7 +472,7 @@ upDownCounter.add(-1,labels); #### Histogram: -```js +```javascript // Create ValueRecorder metric const histogram = meter.createHistogram('test_histogram', { description: 'Example of a histogram',