BedrockStreaming / StatsdBundle

Symfony bundle proving a statsd service and smooth integration in sf2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ip addresses not completed

andrescevp opened this issue · comments

When I try to handle a event with an IP the string must be xxx.xxx.xxx.xxx but just it xxx

you should'nt do that. graphite will split your ip with the dot into several nodes.

you can use the validator https://github.com/M6Web/StatsdBundle/tree/master/src/Validator/Constraints to check your event name

so... I don't understand, you mean that I must validate first the name ? and then try to save the ip ¿

You cannot use a string with dot as a node name as the StatsdBundle himself use dot as separator.

If you define a node named statsd.count.<ip>.connect, and replace "" with "127.0.0.1", StatsBundle will create a node statsd.count.127.0.0.1.connect, with 7 levels instead of 4.

@omansour advise you to use built-in validators to know if your node name is valid or not.

For your problem, you can replace the dot in the IP address by an another character like "_".
So, for my previous example, the created node will be statsd.count.127_0_0_1.connect, with 4 levels

no no, I have a node that: site.client.ip

here I want save the IP from a client so...

$this->get('event_dispatcher')->dispatch('client.ip', new ClientIp($clientIp));

ClientIp class extend from StatsdEvent

statsd cant just handle counter and timers. It's not a logging system.