dynatrace-extensions / dt-extensions-python-sdk

Dynatrace Python Extensions SDK
https://dynatrace-extensions.github.io/dt-extensions-python-sdk/
MIT License
8 stars 1 forks source link

Automatically handle monotonic counter missing timestamps #23

Closed dlopes7 closed 6 months ago

dlopes7 commented 7 months ago

Trying to use MetricType.COUNT without setting a timestamp will result in an error from the EEC:

{'line': 19, 'error': 'timestamp is required for metric of monotonic counter type, rejected entry: rabbitmq.queue.redeliver,cluster="extensions-broker",node="rabbit@localhost",rabbitmq_version="3.11.20",erlang_version="25.3.2.5",dt.dns_names="b-d9835915-0721-47f1-994c-b43c7b6dd800.mq.us-east-1.amazonaws.com",dt.ip_addresses="34.238.175.133",dt.listen_ports="5671",vhost="/",queue="queue-01",durable="True",policy="AWS-DEFAULT-POLICY-SINGLE-INSTANCE",state="running",type="classic" count,0'}

We should automatically add a timestamp if a COUNT metric is provided without one.