-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AMLII-2183] Logs From Integrations Rotation E2E Test and Yaml Templa…
…te (#31812)
- Loading branch information
1 parent
3982cbd
commit 5bd602d
Showing
4 changed files
with
147 additions
and
31 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...new-e2e/tests/agent-metrics-logs/log-agent/linux-log/integrations/fixtures/integration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from datadog_checks.base import AgentCheck | ||
from datadog_checks.base.utils.time import get_timestamp | ||
|
||
|
||
class HelloCheck(AgentCheck): | ||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.counter = 0 # Initialize increasing variable | ||
|
||
def check(self, instance): | ||
data = {} | ||
log_str = instance['log_message'] | ||
data['timestamp'] = get_timestamp() | ||
data['ddtags'] = instance['integration_tags'] | ||
|
||
log_str = instance['log_message'] | ||
if instance['unique_message']: | ||
log_str = instance['log_message'] * instance['log_size'] | ||
self.counter += 1 | ||
log_str = "counter: " + str(self.counter) + ' ' + log_str | ||
data['message'] = log_str | ||
else: | ||
data['message'] = log_str | ||
|
||
num_logs = instance['log_count'] | ||
|
||
if num_logs != 1: | ||
for _ in range(num_logs): | ||
self.send_log(data) | ||
else: | ||
self.send_log(data) |
13 changes: 0 additions & 13 deletions
13
test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/integrations/fixtures/tenLogs.py
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/integrations/fixtures/tenLogs.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters