-
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
Conversation
kafka_consumer/datadog_checks/kafka_consumer/new_kafka_consumer.py
Outdated
Show resolved
Hide resolved
c770c88
to
b00a110
Compare
b00a110
to
ddb0dd9
Compare
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
The |
5408f67
to
6380152
Compare
The |
ba19cad
to
80ccedc
Compare
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 '' |
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.
What does this PR do?
Adds a new metric for the kafka_consumer integration: lag in seconds.
It's a best effort metric, but I think it's still really valuable. Lag in seconds is much more usable than lag in messages (currently available metric).
Motivation
Additional Notes
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached