Repository: DataDog/dd-agent

Issue:
Missing info on fixing: Using events for service checks is deprecated in favor of monitors
It seems that you deprecated a feature without putting any information regarding how to fix it. I even googled and the only reference is the source code where you added this warning.

Please provide some information regarding what changes we are supposed to implement in order not to get these warnings. 

These warnings are showing in the UI:
https://www.dropbox.com/s/xpjpmgqtk71hqze/Screenshot%202014-09-24%2015.43.22.png?dl=0



Discussion:
This happens for me on the `http_check`:

```
    http_check
    ----------
      - instance #0 [WARNING]
          Warning: Using events for service checks is deprecated in favor of monitors and will be removed in future versions of the Datadog Agent.
      - Collected 1 metric, 0 events & 2 service checks
```

The associated `http_check.yaml` looks like:

``` yaml
init_config:

instances:
    -   name: My Domain
        url: http://localhost
        timeout: 2
        threshold: 3
        window: 5
        include_content: true
        collect_response_time: true
        disable_ssl_validation: false
        headers:
           Host: www.mydomain.com
```

Would be nice to get the `http_check` updated at least. Not sure if this is the same check as @ssbarnea is reporting.

Seems to be the same, still no idea on what we need to do to fix it.

Sent from my iPhone

> On 25 Sep 2014, at 18:31, Andy Shinn notifications@github.com wrote:
> 
> This happens for me on the http_check:
> 
> ```
> http_check
> ----------
>   - instance #0 [WARNING]
>       Warning: Using events for service checks is deprecated in favor of monitors and will be removed in future versions of the Datadog Agent.
>   - Collected 1 metric, 0 events & 2 service checks
> ```
> 
> The associated http_check.yaml looks like:
> 
> init_config:
> 
> instances:
>     -   name: My Domain
>         url: http://localhost
>         timeout: 2
>         threshold: 3
>         window: 5
>         include_content: true
>         collect_response_time: true
>         disable_ssl_validation: false
>         headers:
>            Host: www.mydomain.com
> Would be nice to get the http_check updated at least. Not sure if this is the same check as @ssbarnea is reporting.
> 
> —
> Reply to this email directly or view it on GitHub.

Celene mentioned in their IRC channel that it was for a future feature and can be ignored:

```
12:42 PM <celene__> hey goncalop and andyshinn: sorry about that warning, it was in anticipation of a new feature being released but hasn't been yet. that can be ignored for now
```

Hi @ssbarnea @andyshinn 
Sorry about that.
It's indeed because we got delayed in the release of a new feature. You can ignore this warning for now and we might work on a fix server side so it doesn't pollute the infrastructure overview page.

How long do we have to wait for this to be fixed? More than a month passed and 5.0.4 is still the latest release and we do still get Warning notifications in web interface about this deprecation.

Please fix this sooner as it does impact the usability of the product seriously. 

Any update on this?

Hi @ssbarnea , @jonathanhle . Sorry about that, the feature will be enabled for everyone very shortly but  I can enable it for you right one if needed. Could you reach out to our support email address (support _at datadoghq.com ) so we can proceed ?
Thanks!

I am still hoping to see this problem resolved. Running Agent version 5.1.1 and still getting this unclear error.

same here with dd-agent 5.2.1. Pollutes our dd-webviews :-(

@remh Still the case with 

```
-bash-4.2# rpm -qa | grep datadog
datadog-agent-5.3.0-1.x86_64
```

@ineu you should turn the

``` yaml
skip_event
```

flag to True:
https://github.com/DataDog/dd-agent/blob/master/conf.d/http_check.yaml.example#L86-L90

and make sure you've setup a service check on the web app.

@remh It works, thank you.

We getting same warning for the default `system` check. Any update on this? We do not want to turn off `skip_event` on system checks even if it is possible.

+1 getting this on tcp_check 
agent version (v 5.5.1)

```
    tcp_check
    ---------
      - instance #0 [WARNING]
          Warning: Using events for service checks is deprecated in favor of monitors and will be removed in future versions of the Datadog Agent.
      - instance #1 [WARNING]
          Warning: Using events for service checks is deprecated in favor of monitors and will be removed in future versions of the Datadog Agent.
      - instance #2 [WARNING]
          Warning: Using events for service checks is deprecated in favor of monitors and will be removed in future versions of the Datadog Agent.
      - instance #3 [WARNING]
          Warning: Using events for service checks is deprecated in favor of monitors and will be removed in future versions of the Datadog Agent.
      - Collected 4 metrics, 0 events & 5 service checks
```

I do have skip_event: True for all instances inside the http_check.yml and I still see the warning! Even with Collector (v 5.6.3)

@ssbarnea can you share your config ?
I just tried to reproduce but i don't get any warnings when `skip_event: True`

Defining `skip_event: true` in `init_config` seems to have no effect. Defining it as an instance setting works (no deprecation warnings).

**This will output warnings**

``` yaml
init_config:
  skip_event: true
instances:
  - name: sqroot.eu
    url: https://sqroot.eu
```

**This will not**

``` yaml
init_config:
instances:
  - name: sqroot.eu
    skip_event: true
    url: https://sqroot.eu
```

Ideally, I'd like to define this parameter once, globally.

I'm running Dockerized `Collector (v 5.7.3)`.

From the [http_check.yaml.example](https://github.com/DataDog/dd-agent/blob/master/conf.d/http_check.yaml.example)
```
    # The (optional) skip_event parameter will instruct the check to not
    # create any event to avoid duplicates with a server side service check.
    # This default to False.
    #
    skip_event: true
```
I don't understand what this flag controls, it doesn't sound like it 's designed to squelch the dd.collector http_check warnings, more like it disables the machinery behind the warning altogether. I neither assume what it means about it duplicating "server side checks", datadog _is running on the server side_, what other server would duplicate the first server's checks?

My team uses datadog checks for alerting purposes,
What I really would like to know is, would disabling events (enabling skip_events) implicitly disable posting check statuses to datadog? Or is disabling events a safe change for http_checks?
I had the same issue. BUT as ssbarnea mentioned 'skip_event: True' removes the warning.
But the issue here is: 'skip_event: true' doesn't do it.
You have to have an uppercase 'T' 
`skip_event: true` (lowercase t) is working for me with datadog agent 5.10.1 on python 2.7.12. I do have to set that property on every single http_check instance though.
It's 2017, and I still get this warning :+1: 
With `skip_events: true` there is no warning showing up. I am totally fine with this.
Of course a general configution in `init_config` would be better.

Agent: 5.14.1
Here we are in **2018** now and _still_ getting the same error!  WOOOOO!

`2018-01-03 18:31:28 UTC | WARNING | dd.collector | checks.http_check(__init__.py:693) | Using events for service checks is deprecated in favor of monitors and will be removed in future versions of the Datadog Agent.`

M.
Was there a clear upgrading documented for the changes required to move off http_checks to monitors? I haven't stumbled into such document yet :bowing_man: 

Resolving patch:
diff --git a/checks/network_checks.py b/checks/network_checks.py
--- a/checks/network_checks.py
+++ b/checks/network_checks.py
@@ -3,7 +3,6 @@
 # Licensed under Simplified BSD License (see LICENSE)
 
 # stdlib
-from collections import defaultdict
 from Queue import Empty, Queue
 import threading
 import time
@@ -11,7 +10,6 @@
 # project
 from checks import AgentCheck
 from checks.libs.thread_pool import Pool
-from config import _is_affirmative
 
 TIMEOUT = 180
 DEFAULT_SIZE_POOL = 6
@@ -183,45 +181,6 @@ def _process_results(self):
                 continue
 
             self.report_as_service_check(sc_name, status, instance, msg)
-
-            # FIXME: 5.3, this has been deprecated before, get rid of events
-            # Don't create any event to avoid duplicates with server side
-            # service_checks
-            skip_event = _is_affirmative(instance.get('skip_event', False))
-            if not skip_event:
-                self.warning("Using events for service checks is deprecated in favor of monitors and will be removed in future versions of the Datadog Agent.")
-                event = None
-
-                if instance_name not in self.statuses:
-                    self.statuses[instance_name] = defaultdict(list)
-
-                self.statuses[instance_name][sc_name].append(status)
-
-                window = int(instance.get('window', 1))
-
-                if window > 256:
-                    self.log.warning("Maximum window size (256) exceeded, defaulting it to 256")
-                    window = 256
-
-                threshold = instance.get('threshold', 1)
-
-                if len(self.statuses[instance_name][sc_name]) > window:
-                    self.statuses[instance_name][sc_name].pop(0)
-
-                nb_failures = self.statuses[instance_name][sc_name].count(Status.DOWN)
-
-                if nb_failures >= threshold:
-                    if self.notified.get((instance_name, sc_name), Status.UP) != Status.DOWN:
-                        event = self._create_status_event(sc_name, status, msg, instance)
-                        self.notified[(instance_name, sc_name)] = Status.DOWN
-                else:
-                    if self.notified.get((instance_name, sc_name), Status.UP) != Status.UP:
-                        event = self._create_status_event(sc_name, status, msg, instance)
-                        self.notified[(instance_name, sc_name)] = Status.UP
-
-                if event is not None:
-                    self.events.append(event)
-
             self._clean_job(instance_name)
 
     def _clean_job(self, instance_name):


Test patch: