Skip to content
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

[opentelemetry-php-contrib] Auto PDO generates non UTF-8 Strings that makes grpc error out due to an encoding issue #1381

Closed
John98Zakaria opened this issue Sep 19, 2024 · 0 comments · Fixed by open-telemetry/opentelemetry-php-contrib#296
Labels
bug Something isn't working

Comments

@John98Zakaria
Copy link

John98Zakaria commented Sep 19, 2024

Describe your environment Describe any aspect of your environment relevant to the problem, including your php version (php -v will tell you your current version), version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on master.

PHP 8.3.11 (cli) (built: Aug 30 2024 09:27:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.11, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.11, Copyright (c), by Zend Technologies
    with Xdebug v3.3.2, Copyright (c) 2002-2024, by Derick Rethans

Packages:

{
       "ext-opentelemetry": "*",
        "monolog/monolog": "^3.6.0",
        "open-telemetry/exporter-otlp": "1.0.2",
       "open-telemetry/gen-otlp-protobuf": "1.1.0",
        "open-telemetry/opentelemetry-auto-guzzle": "^1.0",
        "open-telemetry/opentelemetry-auto-pdo": "^0.0.15",
        "open-telemetry/opentelemetry-auto-psr14": "^0.0.3",
        "open-telemetry/opentelemetry-auto-symfony": "^1.0.0beta28@beta",
        "open-telemetry/transport-grpc": "1.0.0",
        "symfony/dependency-injection": "^7.0",
        "symfony/http-kernel": "^7.0"
}

Steps to reproduce

Create a query that inserts a binary value

REPLACE INTO theme_child (parent_id, child_id) VALUES ('n�q��N����i\ZD�','���S\0Hޢ��LO~z');

What is the expected behavior?

The query should get sent to opentelemtry

What is the actual behavior?

It errors out when a non UTF-8 query is made (queries that contain binary data)

 Exception: Invalid UTF-8 in string data in /var/www/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/AnyValue.php:64
Stack trace:
#0 /var/www/vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Common/V1/AnyValue.php(64): Google\Protobuf\Internal\Message->writeOneof()
#1 /var/www/vendor/open-telemetry/exporter-otlp/AttributesConverter.php(49): Opentelemetry\Proto\Common\V1\AnyValue->setStringValue()
#2 /var/www/vendor/open-telemetry/exporter-otlp/SpanConverter.php(117): OpenTelemetry\Contrib\Otlp\AttributesConverter::convertAnyValue()
#3 /var/www/vendor/open-telemetry/exporter-otlp/SpanConverter.php(160): OpenTelemetry\Contrib\Otlp\SpanConverter->setAttributes()
#4 /var/www/vendor/open-telemetry/exporter-otlp/SpanConverter.php(78): OpenTelemetry\Contrib\Otlp\SpanConverter->convertSpan()
#5 /var/www/vendor/open-telemetry/exporter-otlp/SpanExporter.php(41): OpenTelemetry\Contrib\Otlp\SpanConverter->convert()
#6 /var/www/vendor/open-telemetry/sdk/Trace/SpanProcessor/BatchSpanProcessor.php(255): OpenTelemetry\Contrib\Otlp\SpanExporter->export()
#7 /var/www/vendor/open-telemetry/sdk/Trace/SpanProcessor/BatchSpanProcessor.php(198): OpenTelemetry\SDK\Trace\SpanProcessor\BatchSpanProcessor->flush()
#8 /var/www/vendor/open-telemetry/sdk/Trace/TracerSharedState.php(98): OpenTelemetry\SDK\Trace\SpanProcessor\BatchSpanProcessor->shutdown()
#9 /var/www/vendor/open-telemetry/sdk/Trace/TracerProvider.php(92): OpenTelemetry\SDK\Trace\TracerSharedState->shutdown()
#10 /var/www/vendor/open-telemetry/sdk/Common/Util/functions.php(36): OpenTelemetry\SDK\Trace\TracerProvider->shutdown()
#11 [internal function]: OpenTelemetry\SDK\Trace\TracerProvider->OpenTelemetry\SDK\Common\Util\{closure}()
#12 /var/www/vendor/open-telemetry/sdk/Common/Util/functions.php(50): Closure->call()
#13 /var/www/vendor/open-telemetry/sdk/Common/Util/ShutdownHandler.php(76): OpenTelemetry\SDK\Common\Util\{closure}()
#14 [internal function]: OpenTelemetry\SDK\Common\Util\ShutdownHandler::OpenTelemetry\SDK\Common\Util\{closure}()
#15 {main}

Additional context
Add any other context about the problem here.

@John98Zakaria John98Zakaria added the bug Something isn't working label Sep 19, 2024
@John98Zakaria John98Zakaria changed the title [opentelemetry-php-contrib] Auto PDO generates non UTF-8 Strings that makes grpc [opentelemetry-php-contrib] Auto PDO generates non UTF-8 Strings that makes grpc error out due to an encoding issue Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant