io icon indicating copy to clipboard operation
io copied to clipboard

Prometheus tutorial notebook is broken

Open stancsz opened this issue 3 years ago • 1 comments

https://github.com/tensorflow/io/blob/master/docs/tutorials/prometheus.ipynb

the ``` dataset = tfio.experimental.IODataset.from_prometheus( "coredns_dns_request_count_total", 5, endpoint="http://localhost:9090")

dataset returned with this call is throwing the following errors

Dataset Spec: (TensorSpec(shape=(), dtype=tf.int64, name=None), {'coredns': {'localhost:9153': {'coredns_dns_request_count_total': TensorSpec(shape=(), dtype=tf.float64, name=None)}}})

CoreDNS Time Series: 4961-07-18 19:49:31: 0.0 4961-07-18 18:49:35: 0.0 4961-07-18 18:49:39: 0.0 4961-07-18 18:49:35: 0.0

InvalidArgumentError Traceback (most recent call last) in () 7 8 print("CoreDNS Time Series:") ----> 9 for (time, value) in dataset: 10 # time is milli second, convert to data time: 11 time = datetime.fromtimestamp(time // 1000)

3 frames /usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/ops.py in raise_from_not_ok_status(e, name) 7184 def raise_from_not_ok_status(e, name): 7185 e.message += (" name: " + name if name is not None else "") -> 7186 raise core._status_to_exception(e) from None # pylint: disable=protected-access 7187 7188

InvalidArgumentError: unable to query prometheus [[{{node IO>PrometheusReadableRead}}]] [Op:IteratorGetNext]

stancsz avatar Feb 16 '22 01:02 stancsz

Hit a similar issue when calling tfio.experimental.IODataset.from_prometheus

: W tensorflow/core/framework/op_kernel.cc:1745] OP_REQUIRES failed at prometheus_kernels.cc:324 : INVALID_ARGUMENT: unable to query prometheus
Traceback (most recent call last):
  ......
  File "/usr/local/lib/python3.7/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 766, in __next__
    return self._next_internal()
  File "/usr/local/lib/python3.7/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 752, in _next_internal
    output_shapes=self._flat_output_shapes)
  File "/usr/local/lib/python3.7/site-packages/tensorflow/python/ops/gen_dataset_ops.py", line 3017, in iterator_get_next
    _ops.raise_from_not_ok_status(e, name)
  File "/usr/local/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 7164, in raise_from_not_ok_status
    raise core._status_to_exception(e) from None  # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: unable to query prometheus
         [[{{node IO>PrometheusReadableRead}}]] [Op:IteratorGetNext]

rootfs avatar Jul 08 '22 15:07 rootfs