<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Serov.eu &#187; symfony</title>
	<atom:link href="https://serov.eu/?feed=rss2&#038;tag=symfony" rel="self" type="application/rss+xml" />
	<link>https://serov.eu</link>
	<description>Блог программиста</description>
	<lastBuildDate>Thu, 30 Apr 2026 12:31:53 +0000</lastBuildDate>
	<language>ru-RU</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.15</generator>
	<item>
		<title>PUSHGATWAY</title>
		<link>https://serov.eu/?p=619</link>
		<comments>https://serov.eu/?p=619#comments</comments>
		<pubDate>Fri, 02 Apr 2021 18:24:46 +0000</pubDate>
		<dc:creator><![CDATA[Evgen]]></dc:creator>
				<category><![CDATA[Программирование]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">https://serov.eu/?p=619</guid>
		<description><![CDATA[Про PUSHGATWAY очень мало написано в инете, особенно под PHP Для установки локально PUSHGATWAY docker-compose.yml: pushgateway: image: prom/pushgateway restart: always container_name: app2022-pushgateway ports: - 9091:9091 - 9090:9090 networks: - front - backend &#160; Есть библиотека для работы с pushgateway https://github.com/PromPHP/prometheus_push_gateway_php -&#62; promphp/prometheus_push_gateway_php &#160; Однако, нашел хороший простой класс, который основан на GuzzleHttp\Client: https://github.com/markarik/wnl-platform/blob/9f4383e850373e1849f04f6d1487268cf91fa615/app/Console/PrometheusPushgateway.php Немного модифицировал его под &#8230; <a href="https://serov.eu/?p=619" class="more-link">Читать далее <span class="screen-reader-text">PUSHGATWAY</span></a>]]></description>
				<content:encoded><![CDATA[<p>Про PUSHGATWAY очень мало написано в инете, особенно под PHP</p>
<p>Для установки локально PUSHGATWAY docker-compose.yml:</p>
<pre>    pushgateway:
        image: prom/pushgateway
        restart: always
        container_name: app2022-pushgateway
        ports:
            - 9091:9091
            - 9090:9090
        networks:
            - front
            - backend

</pre>
<p>&nbsp;</p>
<p>Есть библиотека для работы с pushgateway</p>
<pre>https://github.com/PromPHP/prometheus_push_gateway_php -&gt;
promphp/prometheus_push_gateway_php</pre>
<p>&nbsp;</p>
<p>Однако, нашел хороший простой класс, который основан на GuzzleHttp\Client:</p>
<p>https://github.com/markarik/wnl-platform/blob/9f4383e850373e1849f04f6d1487268cf91fa615/app/Console/PrometheusPushgateway.php</p>
<p>Немного модифицировал его под свои нужды, и получилось вот такое</p>
<pre>&lt;?php
namespace App\Handler;


use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;

class PrometheusPushgateway
{
   public function notify($count, $code=200)
   {

        $url = 'http://pushgateway:9091/metrics/job/symfony/instance/sender';
        $url = getenv('PUSHGATWAY_URL');

      $client = new Client();
      try {
         $bodyLines = [
            "# HELP response_symfony_code_count",
            "# TYPE response_symfony_code_count",
            "response_symfony_code_count {code=\"${code}\"} ${count}"
         ];
         $body = implode("\n", $bodyLines) . "\n";
         $client-&gt;request('POST', $url, [
            'body' =&gt; $body
         ]);
      } catch (GuzzleException $exception) {
          exit('error');
      }
   }
}</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://serov.eu/?feed=rss2&#038;p=619</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>User Deprecated: Since symfony/framework-bundle 5.1: Using type &#171;Symfony\&#8230;.&#187; for argument 1 of method &#171;App\Kernel: configureRoutes()&#187; is deprecated,</title>
		<link>https://serov.eu/?p=613</link>
		<comments>https://serov.eu/?p=613#comments</comments>
		<pubDate>Mon, 29 Mar 2021 10:56:36 +0000</pubDate>
		<dc:creator><![CDATA[Evgen]]></dc:creator>
				<category><![CDATA[Программирование]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">https://serov.eu/?p=613</guid>
		<description><![CDATA[User Deprecated: Since symfony/framework-bundle 5.1: Using type "Symfony\Component\Routing\RouteCollectionBuilder" for argument 1 of method "App\Kernel:configureRoutes()" is deprecated, You need to update Kernel class to start using RoutingConfigurator instead of RouteCollectionBuilder. You can do it automatically by updating the recipe (composer recipes:install symfony/framework-bundle --force)]]></description>
				<content:encoded><![CDATA[<pre>
User Deprecated: Since symfony/framework-bundle 5.1: Using type "Symfony\Component\Routing\RouteCollectionBuilder" for argument 1 of method "App\Kernel:configureRoutes()" is deprecated,


You need to update Kernel class to start using RoutingConfigurator instead of RouteCollectionBuilder.

You can do it automatically by updating the recipe (composer recipes:install symfony/framework-bundle --force)
</pre>
]]></content:encoded>
			<wfw:commentRss>https://serov.eu/?feed=rss2&#038;p=613</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
