Skip to content

Commit

Permalink
Merge branch 'master' into AI-2904/kafka-consumer-revamp
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentClarret committed Mar 16, 2023
2 parents 11aae44 + 0db5a35 commit 03f9661
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 55 deletions.
2 changes: 0 additions & 2 deletions avi_vantage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ No additional installation is needed on your server.

2. [Restart the Agent][5].

**Note**: This check has a limit of 2000 metrics per instance. To see the number of returned metrics, run the Datadog Agent [status command][6]. You can specify the metrics you are interested in by editing the configuration. If you need to monitor more metrics, [contact Datadog support][9].

### Validation

[Run the Agent's status subcommand][6] and look for `avi_vantage` under the Checks section.
Expand Down
2 changes: 2 additions & 0 deletions avi_vantage/datadog_checks/avi_vantage/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
class AviVantageCheck(OpenMetricsBaseCheckV2, ConfigMixin):
__NAMESPACE__ = "avi_vantage"

DEFAULT_METRIC_LIMIT = 0

def __init__(self, name, init_config, instances):
super(AviVantageCheck, self).__init__(name, init_config, instances)
# Required for storing the auth cookie
Expand Down
5 changes: 4 additions & 1 deletion iis/datadog_checks/iis/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ def __init__(
self.service_check_counter = service_check_counter
self.instance_type = instance_type
self.instance_service_check_name = f'{self.instance_type}_up'
self.instances_included = set(instances_included)
if isinstance(instances_included, dict):
self.instances_included = set(instances_included.get('include', []))
else:
self.instances_included = set(instances_included)

# Resets during refreshes
self.instances_unseen = set()
Expand Down
30 changes: 30 additions & 0 deletions kafka_consumer/tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Kafka Consumer integration Dev Setup

## Install `librdkafka`

The kafka-consumer integration leverages the [confluent-kafka](https://github.com/confluentinc/confluent-kafka-python) library. To support Kerberos authentication, this library needs to be built from source, more info can be found [here](https://github.com/confluentinc/confluent-kafka-python#install).

To be able to build the test environments and run the tests, you'll need to manually install `librdkafka` on your host. On MacOS, simply run:

```commandline
brew install librdkafka
```

For other systems, you can follow the instructions [here](https://github.com/confluentinc/confluent-kafka-python/blob/master/INSTALL.md#install-from-source).

Once done, you can run `ddev test kafka_consumer`, the `confluent-kafka` will be built from source.

## Troubleshooting

### fatal error: 'librdkafka/rdkafka.h' file not found

If you face this issue:

```commandline
/private/var/folders/hq/d80ndr2x68g21s07h1nww6qw0000gp/T/pip-install-1v8fm2o0/confluent-kafka_f0f65a0360e648168d1dbcd50ec93912/src/confluent_kafka/src/confluent_kafka.h:23:10: fatal error: 'librdkafka/rdkafka.h' file not found
#include <librdkafka/rdkafka.h>
^~~~~~~~~~~~~~~~~~~~~~
```

1. Make sure you installed `librdkafka` (see the previous section).
2. You might need to set the `C_INCLUDE_PATH` and `LIBRARY_PATH` environments variable to load `librdkafka` when bulding `confluent-kafka`. For instance: `C_INCLUDE_PATH=/opt/homebrew/Cellar/librdkafka/2.0.2/include/ LIBRARY_PATH=/opt/homebrew/Cellar/librdkafka/2.0.2/lib ddev test kafka_consumer`. Setting these environment variables is only needed when the test environment is built (or rebuilt with the `--force-env-rebuild` option).
52 changes: 0 additions & 52 deletions snmp/tests/test_e2e_core_vs_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,10 @@ def test_e2e_v3_version_autodetection(dd_agent_check):
'community_string': '',
}
)
assert_value_metrics = [
'snmp.devices_monitored',
]
assert_python_vs_core(
dd_agent_check,
config,
metrics_to_skip=SKIPPED_CORE_ONLY_METRICS,
assert_value_metrics=assert_value_metrics,
)


Expand All @@ -86,14 +82,10 @@ def test_e2e_v3_explicit_version(dd_agent_check):
'community_string': '',
}
)
assert_value_metrics = [
'snmp.devices_monitored',
]
assert_python_vs_core(
dd_agent_check,
config,
metrics_to_skip=SKIPPED_CORE_ONLY_METRICS,
assert_value_metrics=assert_value_metrics,
)


Expand All @@ -112,14 +104,10 @@ def test_e2e_v3_md5_aes(dd_agent_check):
}
)
metrics_to_skip = SKIPPED_CORE_ONLY_METRICS
assert_value_metrics = [
'snmp.devices_monitored',
]
assert_python_vs_core(
dd_agent_check,
config,
metrics_to_skip=metrics_to_skip,
assert_value_metrics=assert_value_metrics,
)


Expand All @@ -138,14 +126,10 @@ def test_e2e_v3_md5_aes256_blumenthal(dd_agent_check):
}
)
metrics_to_skip = SKIPPED_CORE_ONLY_METRICS
assert_value_metrics = [
'snmp.devices_monitored',
]
assert_python_vs_core(
dd_agent_check,
config,
metrics_to_skip=metrics_to_skip,
assert_value_metrics=assert_value_metrics,
)


Expand All @@ -168,14 +152,10 @@ def test_e2e_v3_md5_aes256_reeder(dd_agent_check):
}
)
metrics_to_skip = SKIPPED_CORE_ONLY_METRICS
assert_value_metrics = [
'snmp.devices_monitored',
]
assert_python_vs_core(
dd_agent_check,
config,
metrics_to_skip=metrics_to_skip,
assert_value_metrics=assert_value_metrics,
)


Expand Down Expand Up @@ -311,15 +291,11 @@ def test_e2e_profile_arista(dd_agent_check):
def test_e2e_profile_aruba(dd_agent_check):
config = common.generate_container_profile_config("aruba")
metrics_to_skip = SKIPPED_CORE_ONLY_METRICS
assert_value_metrics = [
'snmp.devices_monitored',
]
assert_python_vs_core(
dd_agent_check,
config,
expected_total_count=67 + 5,
metrics_to_skip=metrics_to_skip,
assert_value_metrics=assert_value_metrics,
)


Expand All @@ -331,58 +307,42 @@ def test_e2e_profile_chatsworth_pdu(dd_agent_check):
def test_e2e_profile_checkpoint_firewall(dd_agent_check):
config = common.generate_container_profile_config("checkpoint-firewall")
metrics_to_skip = SKIPPED_CORE_ONLY_METRICS
assert_value_metrics = [
'snmp.devices_monitored',
]
assert_python_vs_core(
dd_agent_check,
config,
expected_total_count=301 + 5,
metrics_to_skip=metrics_to_skip,
assert_value_metrics=assert_value_metrics,
)


def test_e2e_profile_cisco_3850(dd_agent_check):
config = common.generate_container_profile_config("cisco-3850")
metrics_to_skip = SKIPPED_CORE_ONLY_METRICS
assert_value_metrics = [
'snmp.devices_monitored',
]
assert_python_vs_core(
dd_agent_check,
config,
expected_total_count=5108 + 5,
metrics_to_skip=metrics_to_skip,
assert_value_metrics=assert_value_metrics,
)


def test_e2e_profile_cisco_asa(dd_agent_check):
config = common.generate_container_profile_config("cisco-asa")
metrics_to_skip = SKIPPED_CORE_ONLY_METRICS
assert_value_metrics = [
'snmp.devices_monitored',
]
assert_python_vs_core(
dd_agent_check,
config,
metrics_to_skip=metrics_to_skip,
assert_value_metrics=assert_value_metrics,
)


def test_e2e_profile_cisco_asa_5525(dd_agent_check):
config = common.generate_container_profile_config("cisco-asa-5525")
metrics_to_skip = SKIPPED_CORE_ONLY_METRICS
assert_value_metrics = [
'snmp.devices_monitored',
]
assert_python_vs_core(
dd_agent_check,
config,
metrics_to_skip=metrics_to_skip,
assert_value_metrics=assert_value_metrics,
)


Expand All @@ -399,14 +359,10 @@ def test_e2e_profile_cisco_csr1000v(dd_agent_check):
def test_e2e_profile_cisco_nexus(dd_agent_check):
config = common.generate_container_profile_config("cisco-nexus")
metrics_to_skip = SKIPPED_CORE_ONLY_METRICS
assert_value_metrics = [
'snmp.devices_monitored',
]
assert_python_vs_core(
dd_agent_check,
config,
metrics_to_skip=metrics_to_skip,
assert_value_metrics=assert_value_metrics,
)


Expand Down Expand Up @@ -436,28 +392,20 @@ def test_e2e_profile_dell_poweredge(dd_agent_check):
def test_e2e_profile_f5_big_ip(dd_agent_check):
config = common.generate_container_profile_config("f5-big-ip")
metrics_to_skip = SKIPPED_CORE_ONLY_METRICS
assert_value_metrics = [
'snmp.devices_monitored',
]
assert_python_vs_core(
dd_agent_check,
config,
metrics_to_skip=metrics_to_skip,
assert_value_metrics=assert_value_metrics,
)


def test_e2e_profile_fortinet_fortigate(dd_agent_check):
config = common.generate_container_profile_config("fortinet-fortigate")
metrics_to_skip = SKIPPED_CORE_ONLY_METRICS
assert_value_metrics = [
'snmp.devices_monitored',
]
assert_python_vs_core(
dd_agent_check,
config,
metrics_to_skip=metrics_to_skip,
assert_value_metrics=assert_value_metrics,
)


Expand Down

0 comments on commit 03f9661

Please sign in to comment.