-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ST with secrets - mysql, elasticsearch, postgresql. Customer facing doc for setting secrets as env variable #4945
Open
sumoanema
wants to merge
16
commits into
main
Choose a base branch
from
postgresqlST
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3310178
Doc for postgresql ST with some correction in doc for postgresql app
sumoanema be109b3
Rearranging folder structure and adding a note for metric collection …
sumoanema 8de16f8
Correct file names, links, sidebars
kimsauce b2ec7f4
Uncomment postgresql source template docs
kimsauce f985e70
Merge branch 'main' into postgresqlST
kimsauce 2b2fad3
ST with secrets - postgresql updated. Mysql and elasticsearch doc added
sumoanema 49c9eb4
Changes from master merged
sumoanema cb4e7c5
Merge branch 'main' into postgresqlST
sumoanema b10cad7
Changelog for postgresql
sumoanema 3e77c4a
Changes to sidebars st to include postgresql, mysql and elasticsearch…
sumoanema a06b33d
adding slug id to mysql and elasticsearch
sumoanema 128a245
minor fixes
JV0812 0c07260
cid redirect correction for st with secrets
sumoanema 545659e
mysql and elasticsearch changes for prerequisite for metrics - settin…
sumoanema 42aa2ae
correction for processing rule referece which was calling PR check fa…
sumoanema 757ff9f
Merge branch 'main' into postgresqlST
sumoanema File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
11 changes: 11 additions & 0 deletions
11
...lemetry-collector/remote-management/source-templates/elasticsearch/changelog.md
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,11 @@ | ||
--- | ||
id: changelog | ||
title: Changelog | ||
sidebar_label: Changelog | ||
description: Changelog for Elasticsearch source template for OpenTelemetry. | ||
--- | ||
|
||
## [1.0.0] - 2025-01-30 | ||
|
||
### Added | ||
- Initial version of Elasticsearch source template. |
100 changes: 100 additions & 0 deletions
100
...entelemetry-collector/remote-management/source-templates/elasticsearch/index.md
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,100 @@ | ||
--- | ||
slug: /send-data/opentelemetry-collector/remote-management/source-templates/elasticsearch | ||
title: Elasticsearch Source Template | ||
sidebar_label: Elasticsearch | ||
description: Learn about the Sumo Logic Elasticsearch source template for OpenTelemetry. | ||
--- | ||
|
||
import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
<head> | ||
<meta name="robots" content="noindex" /> | ||
</head> | ||
|
||
<p><a href="/docs/beta"><span className="beta">Beta</span></a></p> | ||
|
||
<img src={useBaseUrl('img/integrations/databases/elasticsearch.png')} alt="Thumbnail icon" width="100"/> <img src={useBaseUrl('img/send-data/otel-color.svg')} alt="Thumbnail icon" width="30"/> | ||
|
||
The Elasticsearch source template creates an OpenTelemetry configuration that can be pushed to a remotely managed OpenTelemetry collector (abbreviated as otelcol). By creating this source template and pushing the config to the appropriate OpenTelemetry agent, you can ensure collection of Elasticsearch logs and metrics to Sumo Logic. | ||
|
||
## Fields creation in Sumo Logic for Local File | ||
|
||
If not already present, the following [Fields](/docs/manage/fields/) are created as part of source template creation. | ||
|
||
- **`sumo.datasource`**. Fixed value of **elasticsearch**. | ||
- **`deployment.environment`**. This is a user-configured field set at the time of collector installation. It identifies the environment where the host resides, such as `dev`, `prod`, or `qa`. | ||
- **`db.cluster.name`**. User configured. Enter a uniquely identifiable name for your elasticsearch cluster to show in the Sumo Logic dashboards. | ||
- **`db.node.name`**. Includes the value of the hostname of the machine which is being monitored. | ||
|
||
## Prerequisites | ||
|
||
### For metrics collection | ||
|
||
- The Elasticsearch metrics [receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/elasticsearchreceiver) queries the Elasticsearch [node stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html), [cluster health](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html) and [index stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html) endpoints in order to scrape metrics from a running Elasticsearch cluster. This receiver supports Elasticsearch versions 7.9+ | ||
|
||
- Make sure to set the password of Elasticsearch user as an environment variable for OpenTelemetry agent, refer to the [Setting Environment variable with secret values for Source Template](../../st-with-secrets.md). | ||
|
||
### For logs collection | ||
|
||
Elasticsearch supports logging via local text log files. Elasticsearch logs have four levels of verbosity. To select a level, set `loglevel` to one of: | ||
|
||
* **debug**. A lot of information, useful for development/testing. | ||
* **verbose**. Includes information not often needed, but logs less than debug. | ||
* **notice** (default value). Moderately verbose, ideal for production environments. | ||
* **warning**. Only important/critical messages are logged. | ||
|
||
All logging settings are located in [Elasticsearch.conf](https://www.elastic.co/guide/en/elasticsearch/reference/current/logging.html). By default, Elasticsearch logs are stored in `/var/log/elasticsearch/ELK-<Clustername>.log`. The default directory for log files is listed in the Elasticsearch.conf file. | ||
|
||
Ensure that the otelcol has adequate permissions to access all log file paths. Execute the following command: | ||
|
||
```bash | ||
sudo setfacl -R -m d:u:otelcol-sumo:r-x,u:otelcol-sumo:r-x,g:otelcol-sumo:r-x <PATH_TO_LOG_FILE> | ||
``` | ||
|
||
import LogsCollectionPrereqisites from '../../../../../reuse/apps/logs-collection-prereqisites.md'; | ||
|
||
<LogsCollectionPrereqisites/> | ||
|
||
import OtelWindowsLogPrereq from '../../../../../reuse/apps/opentelemetry/log-collection-prerequisite-windows.md'; | ||
|
||
<OtelWindowsLogPrereq/> | ||
|
||
## Configuring the Elasticsearch source template | ||
|
||
You can follow the below steps to set a remotely managed OpenTelemetry collector and push the source template to it. | ||
|
||
### Step 1: Set up remotely managed OpenTelemetry collector | ||
|
||
import CollectorInstallation from '../../../../../reuse/apps/opentelemetry/collector-installation.md'; | ||
|
||
<CollectorInstallation/> | ||
|
||
### Step 2: Configure the source template | ||
|
||
In this step, you will configure the yaml required for Elasticsearch collection. Below are the inputs required for configuration: | ||
|
||
- **Name**. Name of the source template. | ||
- **Description**. Description for the source template. | ||
- **Log Filepath**. Location where the Elasticsearch logs are logged. Please refer to your elasticsearch.conf file. | ||
- **Endpoint**. Enter the url of the server you need to monitor. (default: `localhost:9200`). | ||
- **Username**. Enter the Elasticsearch username. | ||
- **Password Environment Variable Name**. Enter the Elasticsearch password environment variable name. | ||
- **Fields/Metadata**. You can provide any customer fields to be tagged with the data collected. By default, Sumo Logic tags `_sourceCategory` with the value otel/elasticsearch user needs to provide the value for `db.cluster.name`. | ||
|
||
import OtelLogAdvanceOption from '../../../../../reuse/apps/opentelemetry/logs-advance-option-otel.md'; | ||
|
||
<OtelLogAdvanceOption/> | ||
|
||
**Processing Rules**. You can add **processing rules** for logs/metrics collected. To learn more, refer to [Processing Rules](../../processing-rules/index.md). | ||
|
||
### Step 3: Push the source template to the desired remotely managed collectors | ||
|
||
import DataConfiguration from '../../../../../reuse/apps/opentelemetry/data-configuration.md'; | ||
|
||
<DataConfiguration/> | ||
|
||
:::info | ||
Refer to the [changelog](changelog.md) for information on periodic updates to this source template. | ||
::: |
11 changes: 11 additions & 0 deletions
11
...a/opentelemetry-collector/remote-management/source-templates/mysql/changelog.md
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,11 @@ | ||
--- | ||
id: changelog | ||
title: Changelog | ||
sidebar_label: Changelog | ||
description: Changelog for MySQL source template for OpenTelemetry. | ||
--- | ||
|
||
## [1.0.0] - 2025-01-30 | ||
|
||
### Added | ||
- Initial version of MySQL source template. |
110 changes: 110 additions & 0 deletions
110
...-data/opentelemetry-collector/remote-management/source-templates/mysql/index.md
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,110 @@ | ||||||||||||
--- | ||||||||||||
slug: /send-data/opentelemetry-collector/remote-management/source-templates/mysql | ||||||||||||
title: MySQL Source Template | ||||||||||||
sidebar_label: MySQL | ||||||||||||
description: Learn about the Sumo Logic MySQL source template for OpenTelemetry. | ||||||||||||
--- | ||||||||||||
|
||||||||||||
import useBaseUrl from '@docusaurus/useBaseUrl'; | ||||||||||||
import Tabs from '@theme/Tabs'; | ||||||||||||
import TabItem from '@theme/TabItem'; | ||||||||||||
|
||||||||||||
<head> | ||||||||||||
<meta name="robots" content="noindex" /> | ||||||||||||
</head> | ||||||||||||
|
||||||||||||
<p><a href="/docs/beta"><span className="beta">Beta</span></a></p> | ||||||||||||
Comment on lines
+12
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove beta docs code (you indicated these are GA)
Suggested change
|
||||||||||||
|
||||||||||||
<img src={useBaseUrl('img/integrations/databases/mysql.png')} alt="Thumbnail icon" width="100"/> <img src={useBaseUrl('img/send-data/otel-color.svg')} alt="Thumbnail icon" width="30"/> | ||||||||||||
|
||||||||||||
The MySQL source template creates an OpenTelemetry configuration that can be pushed to a remotely managed OpenTelemetry collector (abbreviated as otelcol). By creating this source template and pushing the config to the appropriate OpenTelemetry agent, you can ensure collection of MySQL logs and metrics to Sumo Logic. | ||||||||||||
|
||||||||||||
## Fields creation in Sumo Logic for Local File | ||||||||||||
|
||||||||||||
If not already present, the following [Fields](/docs/manage/fields/) are created as part of source template creation. | ||||||||||||
|
||||||||||||
- **`sumo.datasource`**. Fixed value of **mysql**. | ||||||||||||
- **`deployment.environment`**. This is a user-configured field set at the time of collector installation. It identifies the environment where the host resides, such as `dev`, `prod`, or `qa`. | ||||||||||||
- **`db.cluster.name`**. User configured. Enter a uniquely identifiable name for your mysql cluster to show in the Sumo Logic dashboards. | ||||||||||||
- **`db.node.name`**. Includes the value of the hostname of the machine which is being monitored. | ||||||||||||
|
||||||||||||
## Prerequisites | ||||||||||||
|
||||||||||||
### For metrics collection | ||||||||||||
|
||||||||||||
- The MySQL metrics [receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/mysqlreceiver) collects metrics by querying MySQL's global status and InnoDB tables. This app has been tested with following MySQL versions: 8.0 | ||||||||||||
|
||||||||||||
- Make sure to set the password of MySQL user as an environment variable for OpenTelemetry agent, refer to the [Setting Environment variable with secret values for Source Template](../../st-with-secrets.md). | ||||||||||||
|
||||||||||||
### For logs collection | ||||||||||||
|
||||||||||||
MySQL logs are stored in log files. Slow query logs must be explicitly enabled to be able to be written to a log file. To configure the MySQL log file(s), locate your local `my.cnf` configuration file in the database directory. | ||||||||||||
1. Open `my.cnf` in a text editor. | ||||||||||||
2. Set the following parameters in the `[mysqld]` section: | ||||||||||||
```sql | ||||||||||||
[mysqld] | ||||||||||||
log_error = /var/log/mysql/error.log | ||||||||||||
slow_query_log=1 | ||||||||||||
slow_query_log_file = /var/log/mysql/mysql-slow.log | ||||||||||||
long_query_time=2 | ||||||||||||
``` | ||||||||||||
* [Error Logs](https://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html). By default, error logs are enabled and are logged at file specified by the `log_error` key. | ||||||||||||
* [Slow Query Logs](https://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html). `slow_query_log=1` enables logging of slow queries to the file specified by `slow_query_log_file`. Setting `long_query_time=2` will cause queries that take more than two seconds to execute to be logged. The default value of `long_query_time` is 10 seconds. | ||||||||||||
* [General Query Logs](https://dev.mysql.com/doc/refman/5.7/en/query-log.html). We do not recommend enabling `general_log` for performance reasons. These logs are not used by the Sumo Logic MySQL app. | ||||||||||||
3. Save the `my.cnf` file. | ||||||||||||
4. Restart the MySQL server: | ||||||||||||
```bash | ||||||||||||
sudo mysql.server restart | ||||||||||||
``` | ||||||||||||
Ensure that the otelcol has adequate permissions to access all log file paths. Execute the following command: | ||||||||||||
|
||||||||||||
```bash | ||||||||||||
sudo setfacl -R -m d:u:otelcol-sumo:r-x,u:otelcol-sumo:r-x,g:otelcol-sumo:r-x <PATH_TO_LOG_FILE> | ||||||||||||
``` | ||||||||||||
|
||||||||||||
import LogsCollectionPrereqisites from '../../../../../reuse/apps/logs-collection-prereqisites.md'; | ||||||||||||
|
||||||||||||
<LogsCollectionPrereqisites/> | ||||||||||||
|
||||||||||||
import OtelWindowsLogPrereq from '../../../../../reuse/apps/opentelemetry/log-collection-prerequisite-windows.md'; | ||||||||||||
|
||||||||||||
<OtelWindowsLogPrereq/> | ||||||||||||
|
||||||||||||
## Configuring the MySQL source template | ||||||||||||
|
||||||||||||
You can follow the below steps to set a remotely managed OpenTelemetry collector and push the source template to it. | ||||||||||||
|
||||||||||||
### Step 1: Set up remotely managed OpenTelemetry collector | ||||||||||||
|
||||||||||||
import CollectorInstallation from '../../../../../reuse/apps/opentelemetry/collector-installation.md'; | ||||||||||||
|
||||||||||||
<CollectorInstallation/> | ||||||||||||
|
||||||||||||
### Step 2: Configure the source template | ||||||||||||
|
||||||||||||
In this step, you will configure the yaml required for MySQL collection. Below are the inputs required for configuration: | ||||||||||||
|
||||||||||||
- **Name**. Name of the source template. | ||||||||||||
- **Description**. Description for the source template. | ||||||||||||
- **Error log path**. Location where the SQL Errors are logged. Please refer to your my.cnf file. | ||||||||||||
- **Slow Transaction log file path (optional)**. Location where the Slow SQL transactions are logged. Please refer to your my.cnf file. | ||||||||||||
- **Endpoint**. The URL of the MySQL endpoint (default: `localhost:3306`). | ||||||||||||
- **Username**. Enter the MySQL username. | ||||||||||||
- **Password Environment Variable Name**. Enter the MySQL password environment variable name. | ||||||||||||
- **Fields/Metadata**. You can provide any customer fields to be tagged with the data collected. By default, Sumo Logic tags `_sourceCategory` with the value otel/mysql user needs to provide the value for `db.cluster.name`. | ||||||||||||
|
||||||||||||
import OtelLogAdvanceOption from '../../../../../reuse/apps/opentelemetry/logs-advance-option-otel.md'; | ||||||||||||
|
||||||||||||
<OtelLogAdvanceOption/> | ||||||||||||
|
||||||||||||
**Processing Rules**. You can add **processing rules** for logs/metrics collected. To learn more, refer to [Processing Rules](../../processing-rules/index.md). | ||||||||||||
|
||||||||||||
### Step 3: Push the source template to the desired remotely managed collectors | ||||||||||||
|
||||||||||||
import DataConfiguration from '../../../../../reuse/apps/opentelemetry/data-configuration.md'; | ||||||||||||
|
||||||||||||
<DataConfiguration/> | ||||||||||||
|
||||||||||||
:::info | ||||||||||||
Refer to the [changelog](changelog.md) for information on periodic updates to this source template. | ||||||||||||
::: |
9 changes: 9 additions & 0 deletions
9
...ntelemetry-collector/remote-management/source-templates/postgresql/changelog.md
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,9 @@ | ||
--- | ||
id: changelog | ||
title: Changelog | ||
sidebar_label: Changelog | ||
description: Changelog for PostgreSQL source template for OpenTelemetry. | ||
--- | ||
## [1.0.0] - 2025-01-30 | ||
### Added | ||
- Initial version of PostgreSQL source template. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove beta docs code (you indicated these are GA)