artprima / prometheus-metrics-bundle

Symfony 5/6 Prometheus Metrics Bundle
MIT License
133 stars 29 forks source link

Update symfony/recipes-contrib #75

Closed Johnmeurt closed 2 years ago

Johnmeurt commented 2 years ago

Hello,

The recipes of the v1.14 could be changed to include env var. This could look like:

artprima_prometheus_metrics:
    namespace: myapp
    storage: '%env(PROM_METRICS_DSN)%'

    ignored_routes:
        - prometheus_bundle_prometheus
        - _wdt

    # used to disable default application metrics
#    disable_default_metrics: false

    # used to disable default metrics from promphp/prometheus_client_php
    disable_default_promphp_metrics: true

    # used to enable console metrics
#    enable_console_metrics: false

when@test:
    artprima_prometheus_metrics:
        storage: in_memory

and the manifest:

{
    "bundles": {
        "Artprima\\PrometheusMetricsBundle\\ArtprimaPrometheusMetricsBundle": ["all"]
    },
    "copy-from-recipe": {
        "config/": "%CONFIG_DIR%/"
    },
    "env": {
        "PROM_METRICS_DSN": "apcu"
    }
}

The test config file could be removed. Event the section with the when@test could be removed but I am not sure it is possible to generate a .env.test file.

I thought that was a better idea to submit change here for review / validation before submit a PR on the recipes-contrib repository.

denisvmedia commented 2 years ago

I agree, although unfortunately I don't have time to do that. Are you willing to take care of it?

Johnmeurt commented 2 years ago

My mind is out of space for now but if you are ok with those changes I could make a PR in a couple of days.

denisvmedia commented 2 years ago

Sure, whenever you have time.

Johnmeurt commented 2 years ago

Done. I need someone to make the review.

https://github.com/symfony/recipes-contrib/pull/1416

denisvmedia commented 2 years ago

Thank you @Johnmeurt!