-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new lag in seconds metric #11861
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5047ca1
kafka_consumer: Add lag new metric: lag in seconds
piochelepiotr 0bf6c28
kafka_consumer: Add kafka.consumer_lag_seconds metric
piochelepiotr ddb0dd9
kafka_consumer: go back to python 3.8
piochelepiotr 5f3786f
don't use mock.patch decorator (not available in python 2.7
piochelepiotr aadab87
add metric to metadata file
piochelepiotr 6380152
fix lag in seconds metric
piochelepiotr d70c71a
offset isn't 60 all the time
piochelepiotr 80ccedc
formatting code
piochelepiotr 251c657
fix e2e test
piochelepiotr 5a68369
don't use connection string as cache key
piochelepiotr 59ba943
don't mock for e2e
piochelepiotr a4c779f
e2e test doesn't emit lag in seconds
piochelepiotr bc57a7e
style
piochelepiotr e2f26db
include exception in message
piochelepiotr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
kafka_consumer/datadog_checks/kafka_consumer/datadog_agent.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,17 @@ | ||
# (C) Datadog, Inc. 2020-present | ||
# All rights reserved | ||
# Licensed under Simplified BSD License (see LICENSE) | ||
|
||
from typing import Optional | ||
|
||
try: | ||
from datadog_agent import read_persistent_cache, write_persistent_cache | ||
except ImportError: | ||
|
||
def write_persistent_cache(key, value): | ||
# type: (str, str) -> None | ||
pass | ||
|
||
def read_persistent_cache(key): | ||
# type: (str) -> Optional[str] | ||
return '' | ||
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
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this? The feature has been in the agent for years, the minimun supported base check already has it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I copied it from another check but you have more context than me on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the base check uses the same trick: https://github.com/DataDog/integrations-core/blob/260ef0d91d7e7cfbe541251833b9d24e80202f3c/datadog_checks_base/datadog_checks/base/checks/base.py#L43-L42
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you think it's safe to switch to directly import
datadog_agent
, I'm happy to change it.