Skip to content

Unable to use Performance Monitoring in symfony 4.4 #560

@TheMMSH

Description

@TheMMSH

Environment

How do you use Sentry?
self-hosted 21.9.0

Which SDK and version?
sentry/sentry-symfony 4.2.2

Steps to Reproduce

I've successfully setup sentry, it collects exceptions and errors. I want to configure the sentry.yaml to have Performance Monitoring too. What I found in the official documentation is not a yaml configuration but a Php config that I don't really know how to implement. I imagined that maybe bundles.php is where I have to go but it is a lot of irregular changes for that file. So I searched in this repository and found a full.yaml file which has some related properties but those options are not available for me.

final sentry.yaml after commenting some of the unavailable lines

sentry:
    dsn: '%env(SENTRY_DSN)%'
#    transport_factory: App\Sentry\Transport\TransportFactory
#    logger: app.logger
    options:
        integrations:
            - App\Sentry\Integration\FooIntegration
        default_integrations: false
        send_attempts: 1
        prefixes:
            - '%kernel.project_dir%'
#        sample_rate: 1
#        traces_sample_rate: 1
#        traces_sampler: App\Sentry\Tracing\TracesSampler
        attach_stacktrace: true
        context_lines: 0
        enable_compression: true
        environment: development
        logger: php
        release: 4.0.x-dev
        server_name: localhost
        before_send: App\Sentry\BeforeSendCallback
        tags:
            context: development
        error_types: !php/const E_ALL
        max_breadcrumbs: 1
        before_breadcrumb: App\Sentry\BeforeBreadcrumbCallback
        in_app_exclude:
            - '%kernel.cache_dir%'
        in_app_include:
            - '%kernel.project_dir%'
        send_default_pii: true
        max_value_length: 255
        http_proxy: proxy.example.com:8080
        capture_silenced_errors: true
        max_request_body_size: 'none'
        class_serializers:
            App\FooClass: App\Sentry\Serializer\FooClassSerializer
    messenger:
        enabled: true
        capture_soft_fails: false
    tracing:
        dbal:
            enabled: false
            connections:
                - default
        twig:
            enabled: false
        cache:
            enabled: false
        console:
            excluded_commands:
                - app:command

Expected Result

I though it may start monitoring performance but it didn't.

Actual Result

This error popped up when I tried to reload first page. (the transfer_factory, logger, sample_rate, traces_sample_rate, traces_sampler were all unavailable too.)

Fatal error: Uncaught Symfony\Component\Config\Definition\Exception\InvalidConfigurationException: Unrecognized option "tracing" under "sentry". Available options are "dsn", "listener_priorities", "messenger", "monolog", "options", "register_error_listener". in C:\Users\me\PhpstormProjects\Cafe\vendor\symfony\config\Definition\ArrayNode.php:314 Stack trace: #0 C:\Users\me\PhpstormProjects\Cafe\vendor\symfony\config\Definition\BaseNode.php(410): Symfony\Component\Config\Definition\ArrayNode->normalizeValue(Array) #1 C:\Users\me\PhpstormProjects\Cafe\vendor\symfony\config\Definition\Processor.php(34): Symfony\Component\Config\Definition\BaseNode->normalize(Array) #2 C:\Users\me\PhpstormProjects\Cafe\vendor\symfony\config\Definition\Processor.php(50): Symfony\Component\Config\Definition\Processor->process(Object(Symfony\Component\Config\Definition\ArrayNode), Array) #3 C:\Users\me\PhpstormProjects\Cafe\vendor\symfony\dependency-injection\Extension\Extension.php(111): Symfony\Component\Config\Definition\Processor->p in C:\Users\me\PhpstormProjects\Cafe\vendor\symfony\config\Definition\ArrayNode.php on line 314

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions