Comments (6)
sorry, my bad. It's because I am forgot to initialize the agent for UDP
from php-datadogstatsd.
@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.
`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.
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:
- event uses
curl
, hence is an API wrapper. - increment and service_check, on the other hand, communicate via sockets.
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.
@bittner you should doing this https://app.datadoghq.com/account/settings#agent
from php-datadogstatsd.
@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)
- Unable to set gauge to 0 HOT 1
- No COUNT method?
- Constructor guards HOT 3
- Bools Tag values HOT 1
- Regression: `set()` no longer supports strings
- new release HOT 1
- ->event call's return varies based on whether UDP mode is being used
- Sample rate is affected by the locale HOT 2
- push to dogstatsd in openmetrics format
- Incompatible with upcoming PHP 8.2 release HOT 3
- Push to statsd happens in UDP which is leading to metrics being missed to reach StatsD HOT 8
- Tagged 1.5.6 as 0.5.6
- Incompatible with IPv6
- Link to Laravel Wrapper HOT 3
- Possible incompatibility with Datadog agent ( version 6 ) HOT 4
- typo in readme
- DNS support for UDP transport HOT 1
- BatchedDogStatsd static variables HOT 3
- It is possible to send empty events via UDP
- Depending on `error_log` may result in unseen errors HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-datadogstatsd.