cookbook 'sumologic-otel-collector', '~> 1.0.0'
sumologic-otel-collector (1) Versions 1.0.0 Follow0
Installs sumologic-otel-collector
cookbook 'sumologic-otel-collector', '~> 1.0.0', :supermarket
knife supermarket install sumologic-otel-collector
knife supermarket download sumologic-otel-collector
Chef cookbook to install Sumo Logic Distribution for OpenTelemetry Collector(Linux/Windows)
This cookbook will install Sumo Logic Distro of OpenTelemetry Collector.
Windows Support
- To install the Sumo Logic OpenTelemetry Collector on Windows: Ensure PowerShell execution policy allows scripts:
Set-ExecutionPolicy RemoteSigned -Scope Process -Force
Using the cookbook
- Get an installation token from Sumo Logic
- Prepare configuration file for Sumo Logic Distribution for OpenTelemetry Collector and put the file in a directory of your choice. You can put multiple configuration files in this directory, and all of them will be used.
NOTE: The cookbook will prepare a [base configuration][base_configuration] for you, and configure the extension as well.
Option 1: Using Attributes (Recommended)
Set attributes in your wrapper cookbook, role, or environment:
# In a wrapper cookbook's attributes/default.rb default['sumologic_otel_collector']['installation_token'] = 'your_token' default['sumologic_otel_collector']['collector_tags'] = { 'environment' => 'production', 'team' => 'platform' } default['sumologic_otel_collector']['src_config_path'] = '/etc/otelcol-sumo/conf.d' # In your recipe include_recipe 'sumologic-otel-collector::default'
Option 2: Using JSON File
Create a JSON file with your configuration:
{
"sumologic_otel_collector": {
"installation_token": "your_token",
"collector_tags": {
"environment": "production"
}
},
"run_list": ["recipe[sumologic-otel-collector]"]
}
Apply with chef-solo:
sudo chef-solo -j node.json --config-option cookbook_path=$(pwd)
Option 3: Direct Resource Usage
Use the resource directly in your own recipe:
sumologic_otel_collector 'sumologic-otel-collector' do installation_token 'your_token' collector_tags ({ 'environment' => 'production' }) src_config_path '/etc/otelcol-sumo/conf.d' end
Attributes
All attributes are under the node['sumologic_otel_collector'] namespace.
| Attribute | Type | Description | Default |
|---|---|---|---|
installation_token |
String | Sumo Logic installation token |
nil (required) |
use_vault |
Boolean | Enable Chef Vault for secure credential storage (requires Chef Server) | false |
vault.name |
String | Chef Vault name for credentials | 'sumologic' |
vault.item |
String | Chef Vault item name containing installation token | 'tokens' |
use_data_bag |
Boolean | Enable encrypted data bag for credential storage | false |
credentials.bag_name |
String | Encrypted data bag name | 'sumologic' |
credentials.item_name |
String | Encrypted data bag item name | 'tokens' |
credentials.secret_file |
String | Path to secret file for encrypted data bag decryption | nil |
collector_tags |
Hash | Collector tags, these are applied to all processed data | {} |
api_url |
String | Sumo Logic API url. You shouldn't need to set this in most normal circumstances. | nil |
version |
String | Version of Sumo Logic Distribution for OpenTelemetry Collector. The default is the latest stable version. | nil |
systemd_service |
Boolean | Enables creation of Systemd Service for Sumo Logic Distribution for OpenTelemetry Collector. Enabled by default. Note that this cookbook will not start the collector if you disable this. | true |
src_config_path |
String | Path to configuration directory for Sumo Logic Distribution for OpenTelemetry Collector | nil |
remotely_managed |
Boolean | Enables creation of remotely managed Sumo Logic Distribution for OpenTelemetry Collector. Disabled by default. | false |
opamp_api_url |
String | Sumo Logic Opamp API url. You shouldn't need to set this in most normal circumstances. | nil |
Resource Properties
The sumologic_otel_collector resource accepts the following properties (same as attributes above):
-
installation_token: Sumo Logic installation token (required) -
collector_tags: Collector tags, these are applied to all processed data -
api_url: Sumo Logic API url. You shouldn't need to set this in most normal circumstances. -
version: version of Sumo Logic Distribution for OpenTelemetry Collector. The default is the latest stable version. -
systemd_service: enables creation of Systemd Service for Sumo Logic Distribution for OpenTelemetry Collector. Enabled by default. Note that this cookbook will not start the collector if you disable this. -
src_config_path: path to configuration directory for Sumo Logic Distribution for OpenTelemetry Collector -
remotely_managed: enables creation of remotely managed Sumo Logic Distribution for OpenTelemetry Collector. Disabled by default. -
opamp_api_url: Sumo Logic Opamp API url. You shouldn't need to set this in most normal circumstances.
Test on Vagrant
Chef-solo is installed in Vagrant environment to simplify testing and modifying chef cookbook.
[Chef playground](.) is mounted as /sumologic/examples/chef.
The following steps describe procedure of testing changes:
- Prepare configuration as outlined in Using the cookbook
- From main directory of this repository start virtual machine:
vagrant up
- Connect to virtual machine:
vagrant ssh
- Run the cookbook with the default recipe:
sudo chef-solo -c /sumologic/examples/chef/config.rb -o sumologic-otel-collector
- Verify installation:
sudo ps aux | grep otelcol-sumo
- Verify logs:
sudo journalctl -u otelcol-sumo
- In Windows for verifying the service:
Get-Service -Name OtelcolSumo
Testing
For detailed testing instructions, troubleshooting, and verification steps, see [TESTING.md](TESTING.md).
Contributing
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for Chef cookbook-specific guidelines and the [main repository CONTRIBUTING.md](../../../CONTRIBUTING.md) for general contribution guidelines.
Changelog
See [CHANGELOG.md](CHANGELOG.md) for version history and release notes.
License
This cookbook is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text.
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Changelog
All notable changes to the sumologic-otel-collector cookbook will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
1.0.0 - 2024-03-30
Added
- Initial release of sumologic-otel-collector Chef cookbook
- Support for Linux platforms (Ubuntu, Debian, RHEL, CentOS, Amazon Linux, SUSE)
- Support for Windows platforms (Windows Server 2016+, Windows 10+)
- Custom resource for installing and configuring Sumo Logic OpenTelemetry Collector
- Multiple credential storage methods:
- Chef Vault integration (requires Chef Server)
- Encrypted Data Bags support
- Node attributes (works with chef-solo)
- Configurable collector tags for data classification
- Support for remotely managed collectors via OpAmp
- Systemd service management on Linux
- Windows service management
- Custom configuration directory support
- Comprehensive documentation:
- README.md with usage examples
- CONTRIBUTING.md for developers
- TESTING.md for testing procedures
- Chef-solo support for single-machine deployments
Features
- Automatic installation of latest or specific version of otelcol-sumo
- Flexible attribute-based configuration
- Cross-platform resource implementation
- Service enable and start management
- Configuration file management
- Support for custom API and OpAmp endpoints
Platforms
- Ubuntu (all supported versions)
- Debian (all supported versions)
- RHEL/CentOS (all supported versions)
- Amazon Linux (all supported versions)
- Windows Server 2016+
- Windows 10+
- SUSE (all supported versions)
Requirements
- Chef Infra Client/Workstation 15.3 or higher
- Ruby 2.6 or higher
Collaborator Number Metric
1.0.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Cookstyle Metric
1.0.0 failed this metric
Chef/Modernize/DatabagHelpers: Use the `data_bag_item` helper instead of `Chef::DataBagItem.load` or `Chef::EncryptedDataBagItem.load`. (https://docs.chef.io/workstation/cookstyle/chef_modernize_databaghelpers): sumologic-otel-collector/recipes/default.rb: 35
Chef/Modernize/DatabagHelpers: Use the `data_bag_item` helper instead of `Chef::DataBagItem.load` or `Chef::EncryptedDataBagItem.load`. (https://docs.chef.io/workstation/cookstyle/chef_modernize_databaghelpers): sumologic-otel-collector/recipes/default.rb: 42
Chef/RedundantCode/LongDescriptionMetadata: The long_description metadata.rb method is not used and is unnecessary in cookbooks. (https://docs.chef.io/workstation/cookstyle/chef_redundantcode_longdescriptionmetadata): sumologic-otel-collector/metadata.rb: 8
Run with Cookstyle Version 7.32.1 with cops Chef/Deprecations,Chef/Correctness,Chef/Sharing,Chef/RedundantCode,Chef/Modernize,Chef/Security,InSpec/Deprecations
No Binaries Metric
1.0.0 passed this metric
Testing File Metric
1.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.0 failed this metric
1.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Cookstyle Metric
1.0.0 failed this metric
Chef/Modernize/DatabagHelpers: Use the `data_bag_item` helper instead of `Chef::DataBagItem.load` or `Chef::EncryptedDataBagItem.load`. (https://docs.chef.io/workstation/cookstyle/chef_modernize_databaghelpers): sumologic-otel-collector/recipes/default.rb: 35
Chef/Modernize/DatabagHelpers: Use the `data_bag_item` helper instead of `Chef::DataBagItem.load` or `Chef::EncryptedDataBagItem.load`. (https://docs.chef.io/workstation/cookstyle/chef_modernize_databaghelpers): sumologic-otel-collector/recipes/default.rb: 42
Chef/RedundantCode/LongDescriptionMetadata: The long_description metadata.rb method is not used and is unnecessary in cookbooks. (https://docs.chef.io/workstation/cookstyle/chef_redundantcode_longdescriptionmetadata): sumologic-otel-collector/metadata.rb: 8
Run with Cookstyle Version 7.32.1 with cops Chef/Deprecations,Chef/Correctness,Chef/Sharing,Chef/RedundantCode,Chef/Modernize,Chef/Security,InSpec/Deprecations
No Binaries Metric
1.0.0 passed this metric
Testing File Metric
1.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.0 failed this metric
Chef/Modernize/DatabagHelpers: Use the `data_bag_item` helper instead of `Chef::DataBagItem.load` or `Chef::EncryptedDataBagItem.load`. (https://docs.chef.io/workstation/cookstyle/chef_modernize_databaghelpers): sumologic-otel-collector/recipes/default.rb: 42
Chef/RedundantCode/LongDescriptionMetadata: The long_description metadata.rb method is not used and is unnecessary in cookbooks. (https://docs.chef.io/workstation/cookstyle/chef_redundantcode_longdescriptionmetadata): sumologic-otel-collector/metadata.rb: 8
Run with Cookstyle Version 7.32.1 with cops Chef/Deprecations,Chef/Correctness,Chef/Sharing,Chef/RedundantCode,Chef/Modernize,Chef/Security,InSpec/Deprecations
1.0.0 passed this metric
Testing File Metric
1.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.0 failed this metric
1.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number