Skip to content

Commit

Permalink
fix: documentations links (#1125)
Browse files Browse the repository at this point in the history
  • Loading branch information
weslenteche authored Oct 13, 2023
1 parent b5170bf commit ea86fe1
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 52 deletions.
2 changes: 1 addition & 1 deletion examples/disabling_sdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

require __DIR__ . '/../vendor/autoload.php';

//@see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#general-sdk-configuration
//@see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration
putenv('OTEL_SDK_DISABLED=true');

echo 'Creating (disabled) signals' . PHP_EOL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

use OpenTelemetry\SDK\Trace\TracerProviderFactory;

//@see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md
//@see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md
putenv('OTEL_RESOURCE_ATTRIBUTES=service.version=1.0.0');
putenv('OTEL_SERVICE_NAME=example-app');
putenv('OTEL_LOG_LEVEL=warning');
Expand Down
2 changes: 1 addition & 1 deletion examples/traces/features/span_resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
echo 'Starting ConsoleSpanExporter' . PHP_EOL;

$resource = ResourceInfoFactory::defaultResource()->merge(ResourceInfo::create(Attributes::create([
//@see https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/resource/semantic_conventions
//@see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/semantic-conventions.md
ResourceAttributes::SERVICE_NAMESPACE => 'foo',
ResourceAttributes::SERVICE_NAME => 'bar',
ResourceAttributes::SERVICE_INSTANCE_ID => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contrib/Otlp/MetricExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/**
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/stdout.md#opentelemetry-metrics-exporter---standard-output
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/experimental/serialization/json.md#json-file-serialization
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/file-exporter.md#json-file-serialization
* @psalm-import-type SUPPORTED_CONTENT_TYPES from ProtobufSerializer
*/
final class MetricExporter implements PushMetricExporterInterface, AggregationTemporalitySelectorInterface
Expand Down
22 changes: 12 additions & 10 deletions src/SDK/Common/Configuration/Defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,43 @@

/**
* Default values for environment variables defined by the OpenTelemetry specification and language specific variables for the PHP SDK.
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md
*/
interface Defaults
{
/**
* General SDK Configuration
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#general-sdk-configuration
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration
*/
public const OTEL_LOG_LEVEL = 'info';
public const OTEL_PROPAGATORS = 'tracecontext,baggage';
public const OTEL_TRACES_SAMPLER = 'parentbased_always_on';
public const OTEL_SDK_DISABLED = 'false';
/**
* Batch Span Processor
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#batch-span-processor
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#batch-span-processor
*/
public const OTEL_BSP_SCHEDULE_DELAY = 5000;
public const OTEL_BSP_EXPORT_TIMEOUT = 30000;
public const OTEL_BSP_MAX_QUEUE_SIZE = 2048;
public const OTEL_BSP_MAX_EXPORT_BATCH_SIZE = 512;
/**
* Batch LogRecord Processor
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#batch-logrecord-processor
*/
public const OTEL_BLRP_SCHEDULE_DELAY = 1000;
public const OTEL_BLRP_EXPORT_TIMEOUT = 30000;
public const OTEL_BLRP_MAX_QUEUE_SIZE = 2048;
public const OTEL_BLRP_MAX_EXPORT_BATCH_SIZE = 512;
/**
* Attribute Limits
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#attribute-limits
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#attribute-limits
*/
public const OTEL_ATTRIBUTE_COUNT_LIMIT = 128;
public const OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT = PHP_INT_MAX;
/**
* Span Limits
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#span-limits-
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#span-limits
*/
public const OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT = 128;
public const OTEL_SPAN_EVENT_COUNT_LIMIT = 128;
Expand All @@ -50,6 +51,7 @@ interface Defaults
public const OTEL_LINK_ATTRIBUTE_COUNT_LIMIT = 128;
/**
* LogRecord Limits
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#logrecord-limits
*/
public const OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT = PHP_INT_MAX;
public const OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT = 128;
Expand Down Expand Up @@ -79,27 +81,27 @@ interface Defaults
public const OTEL_EXPORTER_OTLP_LOGS_PROTOCOL = 'http/protobuf';
/**
* Zipkin Exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#zipkin-exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#zipkin-exporter
*/
public const OTEL_EXPORTER_ZIPKIN_ENDPOINT = 'http://localhost:9411/api/v2/spans';
// Timeout (seconds)
public const OTEL_EXPORTER_ZIPKIN_TIMEOUT = 10;
/**
* Prometheus Exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#prometheus-exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#prometheus-exporter
*/
public const OTEL_EXPORTER_PROMETHEUS_HOST = '0.0.0.0';
public const OTEL_EXPORTER_PROMETHEUS_PORT = 9464;
/**
* Exporter Selection
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#exporter-selection
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#exporter-selection
*/
public const OTEL_TRACES_EXPORTER = 'otlp';
public const OTEL_METRICS_EXPORTER = 'otlp';
public const OTEL_LOGS_EXPORTER = 'otlp';
/**
* Metrics SDK Configuration
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#metrics-sdk-configuration
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#metrics-sdk-configuration
*/
public const OTEL_METRICS_EXEMPLAR_FILTER = 'with_sampled_trace';
public const OTEL_METRIC_EXPORT_INTERVAL = 60000;
Expand All @@ -108,7 +110,7 @@ interface Defaults
public const OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION = 'explicit_bucket_histogram';
/**
* Language Specific Environment Variables
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#language-specific-environment-variables
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#language-specific-environment-variables
*/
public const OTEL_PHP_TRACES_PROCESSOR = 'batch';
public const OTEL_PHP_DETECTORS = 'all';
Expand Down
10 changes: 5 additions & 5 deletions src/SDK/Common/Configuration/KnownValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/**
* "Known values" for OpenTelemetry configurataion variables.
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md
* Notice: Values specific to the PHP SDK have been added
*/
interface KnownValues
Expand Down Expand Up @@ -88,7 +88,7 @@ interface KnownValues

/**
* General SDK Configuration
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#general-sdk-configuration
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration
*/
public const OTEL_LOG_LEVEL = [
self::VALUE_LOG_EMERGENCY,
Expand Down Expand Up @@ -136,7 +136,7 @@ interface KnownValues
public const OTEL_EXPORTER_OTLP_METRICS_PROTOCOL = self::VALUES_OTLP_PROTOCOL;
/**
* Exporter Selection
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#exporter-selection
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#exporter-selection
*/
public const OTEL_TRACES_EXPORTER = [
self::VALUE_OTLP,
Expand All @@ -154,7 +154,7 @@ interface KnownValues
];
/**
* Metrics SDK Configuration
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#metrics-sdk-configuration
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#metrics-sdk-configuration
*/
public const OTEL_METRICS_EXEMPLAR_FILTER = [
self::VALUE_WITH_SAMPLED_TRACE,
Expand All @@ -163,7 +163,7 @@ interface KnownValues
];
/**
* Language Specific Environment Variables
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#language-specific-environment-variables
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#language-specific-environment-variables
*/
public const OTEL_PHP_TRACES_PROCESSOR = [
self::VALUE_BATCH,
Expand Down
26 changes: 13 additions & 13 deletions src/SDK/Common/Configuration/ValueTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

/**
* Environment variables defined by the OpenTelemetry specification and language specific variables for the PHP SDK.
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md
*/
interface ValueTypes
{
/**
* General SDK Configuration
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.24.0/specification/configuration/sdk-environment-variables.md#general-sdk-configuration
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration
*/
public const OTEL_RESOURCE_ATTRIBUTES = VariableTypes::MAP;
public const OTEL_SERVICE_NAME = VariableTypes::STRING;
Expand All @@ -22,29 +22,29 @@ interface ValueTypes
public const OTEL_TRACES_SAMPLER_ARG = VariableTypes::MIXED;
/**
* Batch Span Processor
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.24.0/specification/configuration/sdk-environment-variables.md#batch-span-processor
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#batch-span-processor
*/
public const OTEL_BSP_SCHEDULE_DELAY = VariableTypes::INTEGER;
public const OTEL_BSP_EXPORT_TIMEOUT = VariableTypes::INTEGER;
public const OTEL_BSP_MAX_QUEUE_SIZE = VariableTypes::INTEGER;
public const OTEL_BSP_MAX_EXPORT_BATCH_SIZE = VariableTypes::INTEGER;
/**
* Batch LogRecord Processor
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.24.0/specification/configuration/sdk-environment-variables.md#batch-logrecord-processor
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#batch-logrecord-processor
*/
public const OTEL_BLRP_SCHEDULE_DELAY = VariableTypes::INTEGER;
public const OTEL_BLRP_EXPORT_TIMEOUT = VariableTypes::INTEGER;
public const OTEL_BLRP_MAX_QUEUE_SIZE = VariableTypes::INTEGER;
public const OTEL_BLRP_MAX_EXPORT_BATCH_SIZE = VariableTypes::INTEGER;
/**
* Attribute Limits
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.24.0/specification/configuration/sdk-environment-variables.md#attribute-limits
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#attribute-limits
*/
public const OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT = VariableTypes::INTEGER;
public const OTEL_ATTRIBUTE_COUNT_LIMIT = VariableTypes::INTEGER;
/**
* Span Limits
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.24.0/specification/configuration/sdk-environment-variables.md#span-limits
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#span-limits
*/
public const OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT = VariableTypes::INTEGER;
public const OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT = VariableTypes::INTEGER;
Expand All @@ -54,13 +54,13 @@ interface ValueTypes
public const OTEL_LINK_ATTRIBUTE_COUNT_LIMIT = VariableTypes::INTEGER;
/**
* LogRecord Limits
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.24.0/specification/configuration/sdk-environment-variables.md#logrecord-limits
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#logrecord-limits
*/
public const OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT = VariableTypes::INTEGER;
public const OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT = VariableTypes::INTEGER;
/**
* OTLP Exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.24.0/specification/protocol/exporter.md#configuration-options
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options
*/
// Endpoint
public const OTEL_EXPORTER_OTLP_ENDPOINT = VariableTypes::STRING;
Expand Down Expand Up @@ -92,27 +92,27 @@ interface ValueTypes
public const OTEL_EXPORTER_OTLP_METRICS_PROTOCOL = VariableTypes::ENUM;
/**
* Zipkin Exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#zipkin-exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#zipkin-exporter
*/
public const OTEL_EXPORTER_ZIPKIN_ENDPOINT = VariableTypes::STRING;
public const OTEL_EXPORTER_ZIPKIN_TIMEOUT = VariableTypes::INTEGER;
public const OTEL_EXPORTER_ZIPKIN_PROTOCOL = VariableTypes::STRING;
/**
* Prometheus Exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#prometheus-exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#prometheus-exporter
*/
public const OTEL_EXPORTER_PROMETHEUS_HOST = VariableTypes::STRING;
public const OTEL_EXPORTER_PROMETHEUS_PORT = VariableTypes::INTEGER;
/**
* Exporter Selection
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#exporter-selection
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#exporter-selection
*/
public const OTEL_TRACES_EXPORTER = VariableTypes::LIST;
public const OTEL_METRICS_EXPORTER = VariableTypes::LIST;
public const OTEL_LOGS_EXPORTER = VariableTypes::LIST;
/**
* Metrics SDK Configuration
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#metrics-sdk-configuration
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#metrics-sdk-configuration
*/
public const OTEL_METRICS_EXEMPLAR_FILTER = VariableTypes::ENUM;
public const OTEL_METRIC_EXPORT_INTERVAL = VariableTypes::INTEGER;
Expand All @@ -121,7 +121,7 @@ interface ValueTypes
public const OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION = VariableTypes::ENUM;
/**
* Language Specific Environment Variables
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#language-specific-environment-variables
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#language-specific-environment-variables
*/
public const OTEL_PHP_TRACES_PROCESSOR = VariableTypes::ENUM;
public const OTEL_PHP_LOGS_PROCESSOR = VariableTypes::LIST;
Expand Down
Loading

0 comments on commit ea86fe1

Please sign in to comment.