-
Notifications
You must be signed in to change notification settings - Fork 307
Add prometheus dataset support #265
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
Conversation
4e1c11a to
87f775d
Compare
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # ============================================================================== | ||
| """PrometheusInput.""" |
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.
Should be PrometheusDataset
| """Create a Prometheus Reader. | ||
|
|
||
| Args: | ||
| filename: A `tf.string` tensor containing one or more filenames. |
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.
Missing docs for the other args
tests/test_prometheus.py
Outdated
| import tensorflow_io.prometheus as prometheus_io # pylint: disable=wrong-import-position | ||
|
|
||
| if sys.platform == "darwin": | ||
| pytest.skip("pubsub is not supported on macOS yet", allow_module_level=True) |
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.
Remove unnecessary pubsub reference here
tests/test_prometheus.py
Outdated
| # License for the specific language governing permissions and limitations under | ||
| # the License. | ||
| # ============================================================================== | ||
| """Tests for Prometheus Input.""" |
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.
Input -> Dataset
| output_types=self.output_types, | ||
| output_shapes=self.output_shapes) | ||
|
|
||
| @property |
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.
Should we implement all future datasets based on 2.0 tf.data.Dataset?
e0d858e to
50a5d9e
Compare
f24c187 to
d5aac20
Compare
This fix adds prometheus dataset support, with prometheus library in golang. Signed-off-by: Yong Tang <[email protected]>
|
@BryanCutler @terrytangyuan The PR has been updated and now all tests passed. There are several motivations to have a prometheus as data input.
The test case is wired up with CoreDNS as a example server with Prometheus scraping the metrics from CoreDNS. tensorflow-io connects to Prometheus' endpoint to get metrics and delivers as tf.data pipeline. Should be possible to work with tf.keras directly for training or inference. Also cc @ihac in case you are interested in Prometheus+CoreDNS. |
This fix adds prometheus dataset support, with prometheus library in golang. Signed-off-by: Yong Tang <[email protected]>
This fix adds prometheus dataset support, with prometheus library in golang.
This fix fixes #246.
Signed-off-by: Yong Tang [email protected]