Code Monkey home page Code Monkey logo

Comments (6)

kevinralali avatar kevinralali commented on September 26, 2024

sorry, my bad. It's because I am forgot to initialize the agent for UDP

from php-datadogstatsd.

bittner avatar bittner commented on September 26, 2024

@kevinralali Can you provide a sample code? Would be interesting if this helps us.

Because, I think, we have the same or a similar issue for PHP 5.6.30 on Debian Jessie. We can create an event, but not increment a value. (Datadog is investigating internally for this now, according to a support ticket we have opened.)

from php-datadogstatsd.

kevinjon27 avatar kevinjon27 commented on September 26, 2024

@bittner

`function sendDataEmail() {
Datadogstatsd::configure(DOG_KEY, DOG_APP);

$conn = new mysqli(SERVER, USER_DB, PASS_DB, SERVER_DB, PORT_DB);

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT count(*) as total
          FROM rl_bulk_mail 
          WHERE `status`=1 AND proses_time > DATE_SUB(NOW(), INTERVAL 5 MINUTE)";

$query = $conn->query($sql);
$total = 0;
if ($query->num_rows > 0) {
    while($item = $query->fetch_object()){
        for ($i=0;$i < $item->total;$i++) {
            echo "sendDataEmail".PHP_EOL;
            Datadogstatsd::increment(DOG_ENDPOINT.'.bulk_email');
            $total++;
        }
    }

}

}`

Do you have done to initialize the UDP agent?

from php-datadogstatsd.

bittner avatar bittner commented on September 26, 2024

The two Datadogstatsd calls (configure, increment) above are obvious.

But what do I have to do to "initialize the UDP agent"? I don't understand.

More Insights / Analysis Results

I can see from the source code why we can create an event using this client, but not a metric:

IIUC, the latter code must run on the target host, otherwise there is not datadog-agent running to accept the socket connection. The API wrapper code, on the other hand, is independent from the datadog-agent and can run on our developer machines.

from php-datadogstatsd.

kevinralali avatar kevinralali commented on September 26, 2024

@bittner you should doing this https://app.datadoghq.com/account/settings#agent

from php-datadogstatsd.

bittner avatar bittner commented on September 26, 2024

@kevinralali Your link just brings me to the Datadog agent Installation Instructions page. UDP is not explicitly mentioned.

Do you intend that one needs to set up the agent properly (i.e. regularly, as with the "easy one-step install")? Then the statsd client calls should work?

We have that setup, our code for now looks as follows and works with event but does nothing, even when deployed on the target host, when it's increment or service_check:

public function listAction()
{
    \Datadogstatsd::configure('ad**********cv', '0a************b3');
    \Datadogstatsd::service_check('something.service.check',
                                  \Datadogstatsd::OK,
                                  ['something:cron'],
                                  'dev.something.docker',
                                  'test');

    if (....

from php-datadogstatsd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.