|
||
---|---|---|
simple-otel | ||
README.md | ||
install.sh | ||
simple-otel.php |
README.md
Simple Otel Package Installation
Installation
To install or update the Simple Otel package, run the following command from the root of your Concrete5 directory:
curl -sSL https://git.nixc.us/colin/SimpleOtel-c5/raw/branch/main/install.sh | bash
Enabling the Package
After running the install script, you need to install the package. You can do this via the Concrete5 admin dashboard:
- Log in to your Concrete5 admin dashboard.
- Navigate to
Extend Concrete5
. - Find
Simple Otel
in the list and clickInstall
.
What install.sh
Does
The install.sh
script performs the following actions:
- Defines the URL for downloading the
simple-otel.php
file. - Creates the target directory (
packages/simple_otel
) if it doesn't exist. - Downloads the
simple-otel.php
file into the target directory. - Downloads and unzips the
vendor
directory containing pre-installed dependencies. - Creates a blank
config.php
file if it doesn't already exist and provides a template for configuration. - Sets the correct permissions for the
simple-otel.php
andconfig.php
files. - Prints a message indicating that the Simple Otel package has been installed or updated successfully.
Configuration
After installing the package, you can customize its behavior by editing the config.php
file located in packages/simple_otel/
.
Example config.php
Here is an example configuration for the config.php
file:
<?php
// Configuration for Simple Otel plugin
// Add your configurations here
// Set default values using environment variables or fallback to manual configuration
$otel_service_name = getenv('OTEL_SERVICE_NAME') ?: 'default-service-name';
$otel_exporter_otlp_endpoint = getenv('OTEL_EXPORTER_OTLP_ENDPOINT') ?: 'http://localhost:4317';
// Apply configurations
if (isset($GLOBALS['tracer'])) {
$GLOBALS['tracer']->setAttribute('service.name', $otel_service_name);
$GLOBALS['tracer']->setAttribute('otel.exporter.otlp.endpoint', $otel_exporter_otlp_endpoint);
}
?>
Explanation
- Service Name: Set the name of the service as it will appear in your observability platform. It uses the
OTEL_SERVICE_NAME
environment variable if set; otherwise, it defaults todefault-service-name
. - OTLP Endpoint: Specify the endpoint where SigNoz is running. It uses the
OTEL_EXPORTER_OTLP_ENDPOINT
environment variable if set; otherwise, it defaults tohttp://localhost:4317
.
You can add more configuration options as needed. The package will include this file and apply the configurations when it initializes.
Additional Information
For more information on how to use and configure the Simple Otel package, please refer to the documentation or visit the OpenTelemetry PHP documentation.
By following these instructions, you can set up the Simple Otel package with pre-installed dependencies, making it easier for end-users to install and activate the package without needing to run Composer themselves.